1
0
mirror of https://github.com/robbyrussell/oh-my-zsh.git synced 2025-12-06 15:30:40 +01:00

fix(update): define $ZSH if undefined (#12273)

Fixes #12273
Fixes https://github.com/topgrade-rs/topgrade/issues/519
This commit is contained in:
Marc Cornellà
2024-04-18 07:16:42 +02:00
parent eafa78217d
commit c262ffbb68

View File

@@ -10,9 +10,14 @@ fi
# Protect against unwanted sourcing # Protect against unwanted sourcing
case "$ZSH_EVAL_CONTEXT" in case "$ZSH_EVAL_CONTEXT" in
*:file) echo "error: this file should not be sourced" && return ;; *:file) echo "error: this file should not be sourced" && return 1 ;;
esac esac
# Define "$ZSH" if not defined -- in theory this should be `export`ed by the calling script
if [[ -z "$ZSH" ]]; then
ZSH="${0:a:h:h}"
fi
cd "$ZSH" cd "$ZSH"
verbose_mode="default" verbose_mode="default"