mirror of
https://github.com/jorgebucaran/fisher
synced 2024-08-17 12:31:05 +02:00
26 lines
630 B
Fish
26 lines
630 B
Fish
|
function __fisher_xdg -a dir
|
||
|
set -l config $HOME/.config
|
||
|
set -l data $HOME/.local/share
|
||
|
set -l cache $HOME/.cache
|
||
|
|
||
|
switch "$dir"
|
||
|
case --config{,-home}
|
||
|
if set -q XDG_CONFIG_HOME
|
||
|
set config $XDG_CONFIG_HOME
|
||
|
end
|
||
|
printf "%s\n" $config
|
||
|
|
||
|
case --data{,-home}
|
||
|
if set -q XDG_DATA_HOME
|
||
|
set data $XDG_DATA_HOME
|
||
|
end
|
||
|
printf "%s\n" $data
|
||
|
|
||
|
case --cache{,-home}
|
||
|
if set -q XDG_CACHE_HOME
|
||
|
set cache $XDG_CACHE_HOME
|
||
|
end
|
||
|
printf "%s\n" $cache
|
||
|
end
|
||
|
end
|