mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-30 06:03:49 +08:00
10 lines
347 B
Fish
10 lines
347 B
Fish
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
|
|
|