mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-22 08:13:57 +01:00
Use XDG data directory for fish import (#851)
* Use XDG data directory for fish import On MacOS, atuin was looking for fish history under "$HOME/Library/Application Support". Now atuin honors XDG_DATA_HOME, if set, and otherwise uses "$HOME/.local/share". * cargo fmt --------- Co-authored-by: Charles Gould <charles@gould.dev>
This commit is contained in:
parent
a72bf07453
commit
04044c4146
@ -19,7 +19,10 @@ pub struct Fish {
|
||||
/// see https://fishshell.com/docs/current/interactive.html#searchable-command-history
|
||||
fn default_histpath() -> Result<PathBuf> {
|
||||
let base = BaseDirs::new().ok_or_else(|| eyre!("could not determine data directory"))?;
|
||||
let data = base.data_local_dir();
|
||||
let data = std::env::var("XDG_DATA_HOME").map_or_else(
|
||||
|_| base.home_dir().join(".local").join("share"),
|
||||
PathBuf::from,
|
||||
);
|
||||
|
||||
// fish supports multiple history sessions
|
||||
// If `fish_history` var is missing, or set to `default`, use `fish` as the session
|
||||
|
Loading…
Reference in New Issue
Block a user