fix(updater): stop update if `$ZSH` is not a git repository (#10448)

Fixes #10448
parent 15fd9c84
......@@ -133,6 +133,12 @@ function update_ohmyzsh() {
return
fi
# Test if Oh My Zsh directory is a git repository
if ! (cd "$ZSH" && LANG= git rev-parse &>/dev/null); then
echo >&2 "[oh-my-zsh] Can't update: not a git repository."
return
fi
# Check if there are updates available before proceeding
if ! is_update_available; then
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment