d978f385e52a19f2fd41e8c7ceb2f7c0a4dfc56c

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

fix(updater): refresh date of last update only on successful update

Diff

 1diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
 2index d0ceba92d03e1a59839e0a448076c507e9e80c55..88e521eea232a1f89cbf3726268285593ba7abaa 100644
 3--- a/tools/check_for_upgrade.sh
 4+++ b/tools/check_for_upgrade.sh
 5@@ -25,7 +25,9 @@ function update_last_updated_file() {
 6 
 7 function update_ohmyzsh() {
 8   ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive
 9-  update_last_updated_file
10+  if [[ "$?" = (0|80) ]]; then
11+    update_last_updated_file
12+  fi
13 }
14 
15 () {
16diff --git a/tools/upgrade.sh b/tools/upgrade.sh
17index 358242d0f3b1529d53152c3b2196c7b0eed7b793..4b97540d67985a295b64374daed9bd027dbb07c6 100755
18--- a/tools/upgrade.sh
19+++ b/tools/upgrade.sh
20@@ -1,7 +1,7 @@
21 #!/usr/bin/env zsh
22 
23 if [ -z "$ZSH_VERSION" ]; then
24-  exec zsh "$0"
25+  exec zsh "$0" "$@"
26 fi
27 
28 cd "$ZSH"