From d2269180b074263f4a0d3df3f9de15a1abae8110 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 15 Sep 2021 18:41:44 +0200 Subject: fix(core): move plugin-generated completion files to `$ZSH_CACHE_DIR/completions` Fixes #10183 --- oh-my-zsh.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'oh-my-zsh.sh') 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 -- cgit v1.2.3-70-g09d2 From 8784e88552ad7f6f6a9c149a739474e0b168a840 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 15 Sep 2021 20:38:54 +0200 Subject: fix(core): use `$HOME/.cache` if default cache dir is non-writable (#10193) Fixes #10193 --- oh-my-zsh.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 442972a9a..cea466100 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -7,7 +7,12 @@ if [[ -z "$ZSH_CACHE_DIR" ]]; then ZSH_CACHE_DIR="$ZSH/cache" fi -# Create completions cache dir and add to $fpath +# 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}/ohmyzsh" +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) -- cgit v1.2.3-70-g09d2 From 93b557e291ba60286bcd49f5d3e4ac61730b3f7c Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 15 Sep 2021 20:45:26 +0200 Subject: style(core): make alternative cache directory equivalent to Arch Linux package The oh-my-zsh-git package sets the cache directory to `$HOME/.cache/oh-my-zsh`, so Oh My Zsh will be compatible with it. --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index cea466100..83c8f8057 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -9,7 +9,7 @@ fi # 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}/ohmyzsh" + ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh" fi # Create cache and completions dir and add to $fpath -- cgit v1.2.3-70-g09d2 From 2ea1fa6cbfc6340463906dfed589d5c976a10abb Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Fri, 24 Sep 2021 16:50:00 +0200 Subject: fix(init): fix `division by 0` error (#10213) Fixes #10213 --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 83c8f8057..545d980f0 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -14,7 +14,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... if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then -- cgit v1.2.3-70-g09d2