summaryrefslogtreecommitdiff
path: root/oh-my-zsh.sh
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2021-09-15 18:41:44 +0200
committerMarc Cornellà <hello@mcornella.com>2021-09-15 18:41:44 +0200
commitd2269180b074263f4a0d3df3f9de15a1abae8110 (patch)
tree854d05b304d141f55708af51001899d763361496 /oh-my-zsh.sh
parent4e6e49652b69557c01ef1ce81c96da7eb9b34e6e (diff)
downloadzsh-d2269180b074263f4a0d3df3f9de15a1abae8110.tar.gz
zsh-d2269180b074263f4a0d3df3f9de15a1abae8110.tar.bz2
zsh-d2269180b074263f4a0d3df3f9de15a1abae8110.zip
fix(core): move plugin-generated completion files to `$ZSH_CACHE_DIR/completions`
Fixes #10183
Diffstat (limited to 'oh-my-zsh.sh')
-rw-r--r--oh-my-zsh.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh
index 16e244be5..442972a9a 100644
--- a/oh-my-zsh.sh
+++ b/oh-my-zsh.sh
@@ -7,6 +7,10 @@ if [[ -z "$ZSH_CACHE_DIR" ]]; then
ZSH_CACHE_DIR="$ZSH/cache"
fi
+# Create completions cache dir and add to $fpath
+mkdir -p "$ZSH_CACHE_DIR/completions"
+(( ${fpath[(Ie)$ZSH_CACHE_DIR/completions]} )) || fpath=("$ZSH_CACHE_DIR/completions" $fpath)
+
# Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
source $ZSH/tools/check_for_upgrade.sh