浏览代码

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 月之前
父节点
当前提交
11ca9e2ac7
共有 1 个文件被更改,包括 1 次插入1 次删除
  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"