diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-24 17:56:36 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-24 17:56:36 +0200 |
| commit | 9cdc575666faad4c162f4b4cf519bfdd1fd528dc (patch) | |
| tree | 9287963ad11e237ca74edbd54161c03f3309927b /crates/common/src/utils.rs | |
| parent | chore: Last big refactoring (diff) | |
| download | atuin-9cdc575666faad4c162f4b4cf519bfdd1fd528dc.zip | |
feat: Finalize design for fish-shell integration
Diffstat (limited to '')
| -rw-r--r-- | crates/common/src/utils.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/crates/common/src/utils.rs b/crates/common/src/utils.rs index 7f46f223..b50328a9 100644 --- a/crates/common/src/utils.rs +++ b/crates/common/src/utils.rs @@ -91,33 +91,36 @@ pub fn in_git_repo(path: &str) -> Option<PathBuf> { // I don't want to use ProjectDirs, it puts config in awkward places on // mac. Data too. Seems to be more intended for GUI apps. +#[must_use] pub fn home_dir() -> PathBuf { directories::BaseDirs::new() .map(|d| d.home_dir().to_path_buf()) .expect("could not determine home directory") } +#[must_use] pub fn config_dir() -> PathBuf { let config_dir = env::var("XDG_CONFIG_HOME").map_or_else(|_| home_dir().join(".config"), PathBuf::from); - config_dir.join("atuin") + config_dir.join("turtle") } +#[must_use] pub fn data_dir() -> PathBuf { let data_dir = env::var("XDG_DATA_HOME") .map_or_else(|_| home_dir().join(".local").join("share"), PathBuf::from); - data_dir.join("atuin") + data_dir.join("turtle") } #[must_use] -pub fn runtime_dir() -> PathBuf { - env::var("XDG_RUNTIME_DIR").map_or_else(|_| data_dir(), PathBuf::from) +pub fn daemon_socket_path() -> PathBuf { + runtime_dir().join("turtle.sock") } #[must_use] -pub fn logs_dir() -> PathBuf { - home_dir().join(".atuin").join("logs") +pub fn runtime_dir() -> PathBuf { + env::var("XDG_RUNTIME_DIR").map_or_else(|_| data_dir(), PathBuf::from) } #[must_use] |
