Browse Source

fix(init): add cached completions directory only once (#12551)

Double quotes within the subscript test are interpreted literally, making the
test never match. On subsequent runs, the `$ZSH_CACHE_DIR/completions` directory
is always prepended to `$fpath`, even if it is already there. This commit fixes
that.

Fixes #12551

Co-authored-by: Adem Simsek <adem@simsek.dev>
Marc Cornellà 9 months ago
parent
commit
11ca9e2ac7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      oh-my-zsh.sh

+ 1 - 1
oh-my-zsh.sh

@@ -65,7 +65,7 @@ fi
 
 # Create cache and completions dir and add to $fpath
 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)
 
 # Check for updates on initial load...
 source "$ZSH/tools/check_for_upgrade.sh"