+check for Fisherman directories when sourcing its config

This commit is contained in:
Daniel Maslowski 2016-03-26 17:44:28 +01:00
parent c5c1361120
commit 41b1495c4a

View file

@ -1,3 +1,23 @@
# If fisher_home is not provided, use the directory of this file:
set -q fisher_home; or set -g fisher_home (dirname (status -f))
# If fisher_config is not provided, set it up:
set -q fisher_config
or if test ! -z "$XDG_CONFIG_HOME"
set -g fisher_config $XDG_CONFIG_HOME/fisherman
else
# if XDG home is unset or empty, use ~/.config as a fallback
set -g fisher_config ~/.config/fisherman
end
# To not break fish, we need to make sure the config dir exists:
if test ! -d "$fisher_config"
echo "Setting up Fisherman config dir..."
mkdir -p "$fisher_config/cache"
touch "$fisher_config/fishfile"
echo "Done."
end
set -g fisher_file $fisher_config/fishfile
set -g fisher_cache $fisher_config/cache
set -g fisher_binds $fisher_config/key_bindings.fish