浏览代码

fix(upgrade): do not upgrade if not called from tty

Fixes #11390
Carlo Sala 1 年之前
父节点
当前提交
fe0dd8226d
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 4 0
      .prettierrc
  2. 2 0
      tools/check_for_upgrade.sh

+ 4 - 0
.prettierrc

@@ -0,0 +1,4 @@
+{
+  "printWidth": 110,
+  "proseWrap": "always"
+}

+ 2 - 0
tools/check_for_upgrade.sh

@@ -21,9 +21,11 @@ zstyle -s ':omz:update' mode update_mode || {
 # Cancel update if:
 # - the automatic update is disabled.
 # - the current user doesn't have write permissions nor owns the $ZSH directory.
+# - is not run from a tty
 # - git is unavailable on the system.
 if [[ "$update_mode" = disabled ]] \
    || [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \
+   || [[ ! -t 1 ]] \
    || ! command git --version 2>&1 >/dev/null; then
   unset update_mode
   return