mirror of
https://github.com/zdharma-continuum/zinit.git
synced 2026-09-10 07:36:38 -04:00
changes to check if ZSH_CACHE_DIR is writable.
This commit is contained in:
parent
88a9ff98ac
commit
351df735d1
|
|
@ -149,6 +149,12 @@ typeset -g ZPFX
|
|||
|
||||
ZINIT[PLUGINS_DIR]=${~ZINIT[PLUGINS_DIR]} ZINIT[COMPLETIONS_DIR]=${~ZINIT[COMPLETIONS_DIR]}
|
||||
ZINIT[SNIPPETS_DIR]=${~ZINIT[SNIPPETS_DIR]} ZINIT[SERVICES_DIR]=${~ZINIT[SERVICES_DIR]}
|
||||
|
||||
# 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}/zinit"
|
||||
fi
|
||||
|
||||
export ZPFX=${~ZPFX} ZSH_CACHE_DIR="${ZSH_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/zinit}" \
|
||||
PMSPEC=0uUpiPsf
|
||||
[[ -z ${path[(re)$ZPFX/bin]} ]] && [[ -d "$ZPFX/bin" ]] && path=( "$ZPFX/bin" "${path[@]}" )
|
||||
|
|
|
|||
Loading…
Reference in a new issue