mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-13 09:20:09 +00:00
fix(core): use $HOME/.cache
if default cache dir is non-writable (#10193)
Fixes #10193
This commit is contained in:
parent
eb2eacaf0c
commit
8784e88552
1 changed files with 6 additions and 1 deletions
|
@ -7,7 +7,12 @@ if [[ -z "$ZSH_CACHE_DIR" ]]; then
|
||||||
ZSH_CACHE_DIR="$ZSH/cache"
|
ZSH_CACHE_DIR="$ZSH/cache"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create completions cache dir and add to $fpath
|
# Make sure $ZSH_CACHE_DIR is writable, otherwise use a directory in $HOME
|
||||||
|
if [[ ! -w "$ZSH_CACHE_DIR" ]]; then
|
||||||
|
ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/ohmyzsh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create cache and completions dir and add to $fpath
|
||||||
mkdir -p "$ZSH_CACHE_DIR/completions"
|
mkdir -p "$ZSH_CACHE_DIR/completions"
|
||||||
(( ${fpath[(Ie)$ZSH_CACHE_DIR/completions]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath)
|
(( ${fpath[(Ie)$ZSH_CACHE_DIR/completions]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue