From 11ca9e2ac7c70b4682e6b7d1e50a1a1cb7c1a5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Sat, 13 Jul 2024 18:22:06 +0200 Subject: [PATCH] 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 --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 694095afa..906d19a45 100644 --- a/oh-my-zsh.sh +++ b/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"