From fe0dd8226d6f58ea98f9f84b279e6c3859993fb9 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 19 Dec 2022 23:33:55 +0100 Subject: [PATCH] fix(upgrade): do not upgrade if not called from tty Fixes #11390 --- .prettierrc | 4 ++++ tools/check_for_upgrade.sh | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..a8f5a14b0 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,4 @@ +{ + "printWidth": 110, + "proseWrap": "always" +} diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 3a6bb6555..734714c94 100644 --- a/tools/check_for_upgrade.sh +++ b/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