mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:41:15 -03:00
Add $__fish_config_dir variable
Contains the path to the user config.fish (e.g. ~/.config/fish) without having to do the `set -q XDG_CONFIG_HOME` dance. See #5270.
This commit is contained in:
@@ -8,12 +8,7 @@ function funcsave --description "Save the current definition of all specified fu
|
||||
return 0
|
||||
end
|
||||
|
||||
set -l configdir ~/.config
|
||||
if set -q XDG_CONFIG_HOME
|
||||
set configdir $XDG_CONFIG_HOME
|
||||
end
|
||||
|
||||
if not mkdir -p $configdir/fish/functions
|
||||
if not mkdir -p $__fish_config_dir/functions
|
||||
printf (_ "%s: Could not create configuration directory\n") funcsave
|
||||
return 1
|
||||
end
|
||||
@@ -21,7 +16,7 @@ function funcsave --description "Save the current definition of all specified fu
|
||||
set -l retval 0
|
||||
for funcname in $argv
|
||||
if functions -q -- $funcname
|
||||
functions -- $funcname >$configdir/fish/functions/$funcname.fish
|
||||
functions -- $funcname >$__fish_config_dir/functions/$funcname.fish
|
||||
else
|
||||
printf (_ "%s: Unknown function '%s'\n") funcsave $funcname
|
||||
set retval 1
|
||||
|
||||
Reference in New Issue
Block a user