Skip to content

Commit b5411e2

Browse files
authored
Set MacOS config directory to ~/.config (#379)
1 parent be3a33e commit b5411e2

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
### Fixed
1616
- compilation broken on freebsd ([#461](https://github.com/extrawurst/gitui/issues/461))
1717
- don’t fail if `user.name` is not set [[@cruessler](https://github.com/cruessler)] ([#79](https://github.com/extrawurst/gitui/issues/79)) ([#228](https://github.com/extrawurst/gitui/issues/228))
18+
- set MacOS config directory to ~/.config [[@remique](https://github.com/remique)] ([#317](https://github.com/extrawurst/gitui/issues/317))
1819

1920
## [0.11.0] - 2020-12-20
2021

KEY_CONFIG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This file allows changing every key binding.
99

1010
The config file format based on the [Ron file format](https://github.com/ron-rs/ron).
1111
The location of the file depends on your OS:
12-
* `$HOME/Library/Application Support/gitui/key_config.ron` (mac)
12+
* `$HOME/.config/gitui/key_config.ron` (mac)
1313
* `$XDG_CONFIG_HOME/gitui/key_config.ron` (linux using XDG)
1414
* `$HOME/.config/gitui/key_config.ron` (linux)
1515

src/main.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,12 @@ fn get_app_cache_path() -> Result<PathBuf> {
244244
}
245245

246246
fn get_app_config_path() -> Result<PathBuf> {
247-
let mut path = dirs_next::config_dir()
248-
.ok_or_else(|| anyhow!("failed to find os config dir."))?;
247+
let mut path = if cfg!(target_os = "macos") {
248+
dirs_next::home_dir().map(|h| h.join(".config"))
249+
} else {
250+
dirs_next::config_dir()
251+
}
252+
.ok_or_else(|| anyhow!("failed to find os config dir."))?;
249253

250254
path.push("gitui");
251255
fs::create_dir_all(&path)?;

0 commit comments

Comments
 (0)