Skip to content

Commit

Permalink
differentiate status message between plugin updated / already at the …
Browse files Browse the repository at this point in the history
…latest version
  • Loading branch information
tamcore committed Apr 24, 2022
1 parent e309ccf commit 85eeee7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion autoupdate.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,16 @@ function upgrade_oh_my_zsh_custom() {
pt=$(basename ${pt:0:((${#pt} - 1))})
pushd -q "${p}"

last_head=$( git rev-parse HEAD )
if git pull --rebase --stat --autostash
then
printf "${BLUE}%s${NORMAL}\n" "Hooray! the $pn $pt has been updated and/or is at the current version."
curr_head=$( git rev-parse HEAD )
if [ "${last_head}" != "${curr_head}" ]
then
printf "${BLUE}%s${NORMAL}\n" "Hooray! the $pn $pt has been updated."
else
printf "${BLUE}%s${NORMAL}\n" "The $pn $pt was already at the latest version."
fi
else
printf "${RED}%s${NORMAL}\n" "There was an error updating the $pn $pt. Try again later?"
fi
Expand Down

0 comments on commit 85eeee7

Please sign in to comment.