a55a30ec3933704e1a4a77f533fe7a21266d97fd

Author
Lucas Larson <91468+LucasLarson@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

update: return git error code on failure (#9238)

Fixes #9237

Diff

 1diff --git a/tools/upgrade.sh b/tools/upgrade.sh
 2index a71dec88b5017e1c68c3650fb0097d154bd4ee3c..e005519d6d4c9b0e7edcdc17a183e1820538905f 100644
 3--- a/tools/upgrade.sh
 4+++ b/tools/upgrade.sh
 5@@ -68,6 +68,7 @@ then
 6   printf "${BLUE}${BOLD}%s ${UNDER}%s${RESET}\n" "Want to get involved in the community? Join our Discord:" "https://discord.gg/ohmyzsh"
 7   printf "${BLUE}${BOLD}%s ${UNDER}%s${RESET}\n" "Get your Oh My Zsh swag at:" "https://shop.planetargon.com/collections/oh-my-zsh"
 8 else
 9+  status=$?
10   printf "${RED}%s${RESET}\n" 'There was an error updating. Try again later?'
11 fi
12 
13@@ -76,3 +77,6 @@ case "$resetAutoStash" in
14   "") git config --unset rebase.autoStash ;;
15   *) git config rebase.autoStash "$resetAutoStash" ;;
16 esac
17+
18+# Exit with `1` if the update failed
19+exit $status