diff options
author | remique <44347542+remique@users.noreply.github.com> | 2021-02-16 22:52:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-16 22:52:32 +0100 |
commit | b5411e28a5e31ea4bb80ddc5f3fe32c824f59af0 (patch) | |
tree | 103a8bcb38a2596999237f469052bd3d3a57f6f5 /src/main.rs | |
parent | be3a33e86291ff095bc420d5fdaa11822df84b35 (diff) |
Set MacOS config directory to ~/.config (#379)
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index e1e45ec0..47972eae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -244,8 +244,12 @@ fn get_app_cache_path() -> Result<PathBuf> { } fn get_app_config_path() -> Result<PathBuf> { - let mut path = dirs_next::config_dir() - .ok_or_else(|| anyhow!("failed to find os config dir."))?; + let mut path = if cfg!(target_os = "macos") { + dirs_next::home_dir().map(|h| h.join(".config")) + } else { + dirs_next::config_dir() + } + .ok_or_else(|| anyhow!("failed to find os config dir."))?; path.push("gitui"); fs::create_dir_all(&path)?; |