summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorCarlo Sala <carlosalag@protonmail.com>2022-12-19 23:33:55 +0100
committerCarlo Sala <carlosalag@protonmail.com>2023-01-17 12:48:05 +0100
commitfe0dd8226d6f58ea98f9f84b279e6c3859993fb9 (patch)
treee6a4cd4d83a911220273357103d130eaf2104d2c /tools
parent5b9de6a5304ad5f74ccb5862122a23b9ba06f6e3 (diff)
downloadzsh-fe0dd8226d6f58ea98f9f84b279e6c3859993fb9.tar.gz
zsh-fe0dd8226d6f58ea98f9f84b279e6c3859993fb9.tar.bz2
zsh-fe0dd8226d6f58ea98f9f84b279e6c3859993fb9.zip
fix(upgrade): do not upgrade if not called from tty
Fixes #11390
Diffstat (limited to 'tools')
-rw-r--r--tools/check_for_upgrade.sh2
1 files changed, 2 insertions, 0 deletions
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