浏览代码

Convert "if then" statements to "if; then" one-liners

Fabian Wolff 7 年之前
父节点
当前提交
1f64fa92f5
共有 1 个文件被更改,包括 4 次插入8 次删除
  1. 4 8
      tools/check_for_upgrade.sh

+ 4 - 8
tools/check_for_upgrade.sh

@@ -29,10 +29,8 @@ fi
 # Cancel upgrade if git is unavailable on the system
 whence git >/dev/null || return 0
 
-if mkdir "$ZSH/log/update.lock" 2>/dev/null
-then
-  if [ -f ~/.zsh-update ]
-  then
+if mkdir "$ZSH/log/update.lock" 2>/dev/null; then
+  if [ -f ~/.zsh-update ]; then
     . ~/.zsh-update
 
     if [[ -z "$LAST_EPOCH" ]]; then
@@ -40,10 +38,8 @@ then
     fi
 
     epoch_diff=$(($(_current_epoch) - $LAST_EPOCH))
-    if [ $epoch_diff -gt $epoch_target ]
-    then
-      if [ "$DISABLE_UPDATE_PROMPT" = "true" ]
-      then
+    if [ $epoch_diff -gt $epoch_target ]; then
+      if [ "$DISABLE_UPDATE_PROMPT" = "true" ]; then
         _upgrade_zsh
       else
         echo "[Oh My Zsh] Would you like to check for updates? [Y/n]: \c"