From e8e37eedbc8cf5e446be11971769df7cc10faeb0 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 12 Dec 2020 13:41:29 +0100 Subject: feat(updater): save version prior to updating so `omz changelog` just works™ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #9505 --- tools/upgrade.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools/upgrade.sh') diff --git a/tools/upgrade.sh b/tools/upgrade.sh index cfd424527..4df7eb184 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -10,7 +10,7 @@ cd "$ZSH" # and that terminal supports them. local -a RAINBOW -local RED GREEN YELLOW BLUE UNDER BOLD RESET +local RED GREEN YELLOW BLUE BOLD DIM UNDER RESET if [ -t 1 ]; then RAINBOW=( @@ -28,6 +28,7 @@ if [ -t 1 ]; then YELLOW=$(printf '\033[33m') BLUE=$(printf '\033[34m') BOLD=$(printf '\033[1m') + DIM=$(printf '\033[2m') UNDER=$(printf '\033[4m') RESET=$(printf '\033[m') fi @@ -69,6 +70,9 @@ if git pull --rebase --stat origin master; then else message="Hooray! Oh My Zsh has been updated!" + # Save the commit prior to updating + git config oh-my-zsh.lastVersion "$last_commit" + # Display changelog with less if available, otherwise just print it to the terminal if [[ "$1" = --interactive ]]; then if (( $+commands[less] )); then @@ -77,6 +81,8 @@ if git pull --rebase --stat origin master; then "$ZSH/tools/changelog.sh" HEAD "$last_commit" fi fi + + printf "${BLUE}%s \`${BOLD}%s${RESET}${BLUE}\`${RESET}\n" "You can see the changelog again with" "omz changelog" fi printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET -- cgit v1.2.3-70-g09d2