diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-04-03 10:19:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-03 10:19:24 +0100 |
| commit | 894eaa6faff86e1839510e114427b949b2440d39 (patch) | |
| tree | 7bbda2eebb75b79292f3095017c44ebc97387654 /atuin-common | |
| parent | feat: add 'ctrl-a a' to jump to beginning of line (#1917) (diff) | |
| download | atuin-894eaa6faff86e1839510e114427b949b2440d39.zip | |
perf(dotfiles): cache aliases and read straight from file (#1918)
* cache aliases when set locally
* handle rebuild on sync and tidy things a bit
* support all shells except nu
* make clippy happy
* fmt
* fix for no features
Diffstat (limited to 'atuin-common')
| -rw-r--r-- | atuin-common/src/utils.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/atuin-common/src/utils.rs b/atuin-common/src/utils.rs index 1e0f5a9a..7c533663 100644 --- a/atuin-common/src/utils.rs +++ b/atuin-common/src/utils.rs @@ -75,6 +75,14 @@ pub fn data_dir() -> PathBuf { data_dir.join("atuin") } +pub fn dotfiles_cache_dir() -> PathBuf { + // In most cases, this will be ~/.local/share/atuin/dotfiles/cache + let data_dir = std::env::var("XDG_DATA_HOME") + .map_or_else(|_| home_dir().join(".local").join("share"), PathBuf::from); + + data_dir.join("atuin").join("dotfiles").join("cache") +} + pub fn get_current_dir() -> String { // Prefer PWD environment variable over cwd if available to better support symbolic links match env::var("PWD") { |
