mirror of
https://github.com/extrawurst/gitui.git
synced 2024-11-22 02:12:58 +03:00
Set MacOS config directory to ~/.config (#379)
This commit is contained in:
parent
be3a33e862
commit
b5411e28a5
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Fixed
|
||||
- compilation broken on freebsd ([#461](https://github.com/extrawurst/gitui/issues/461))
|
||||
- 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))
|
||||
- set MacOS config directory to ~/.config [[@remique](https://github.com/remique)] ([#317](https://github.com/extrawurst/gitui/issues/317))
|
||||
|
||||
## [0.11.0] - 2020-12-20
|
||||
|
||||
|
@ -9,7 +9,7 @@ This file allows changing every key binding.
|
||||
|
||||
The config file format based on the [Ron file format](https://github.com/ron-rs/ron).
|
||||
The location of the file depends on your OS:
|
||||
* `$HOME/Library/Application Support/gitui/key_config.ron` (mac)
|
||||
* `$HOME/.config/gitui/key_config.ron` (mac)
|
||||
* `$XDG_CONFIG_HOME/gitui/key_config.ron` (linux using XDG)
|
||||
* `$HOME/.config/gitui/key_config.ron` (linux)
|
||||
|
||||
|
@ -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)?;
|
||||
|
Loading…
Reference in New Issue
Block a user