2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-01-29 13:23:33 +00:00
fish-shell/share/functions/__fish_make_cache_dir.fish

9 lines
346 B
Fish
Raw Normal View History

function __fish_make_cache_dir --description "Create and return XDG_CACHE_HOME"
set -l xdg_cache_home $XDG_CACHE_HOME
if test -z "$xdg_cache_home"; or string match -qv '/*' -- $xdg_cache_home; or set -q xdg_cache_home[2]
set xdg_cache_home $HOME/.cache
end
mkdir -m 700 -p $xdg_cache_home
and echo $xdg_cache_home
end