浏览代码

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

Marc Cornellà 3 年之前
父节点
当前提交
d978f385e5
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 3 1
      tools/check_for_upgrade.sh
  2. 1 1
      tools/upgrade.sh

+ 3 - 1
tools/check_for_upgrade.sh

@@ -25,7 +25,9 @@ function update_last_updated_file() {
 
 function update_ohmyzsh() {
   ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive
-  update_last_updated_file
+  if [[ "$?" = (0|80) ]]; then
+    update_last_updated_file
+  fi
 }
 
 () {

+ 1 - 1
tools/upgrade.sh

@@ -1,7 +1,7 @@
 #!/usr/bin/env zsh
 
 if [ -z "$ZSH_VERSION" ]; then
-  exec zsh "$0"
+  exec zsh "$0" "$@"
 fi
 
 cd "$ZSH"