Skip to content

Commit

Permalink
fix(update): define $ZSH if undefined (ohmyzsh#12273)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcornella committed Apr 18, 2024
1 parent eafa782 commit c262ffb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ fi

# Protect against unwanted sourcing
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

# 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"

verbose_mode="default"
Expand Down

0 comments on commit c262ffb

Please sign in to comment.