Commit fe0dd822 authored by Carlo Sala's avatar Carlo Sala

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

Fixes #11390
parent 5b9de6a5
{
"printWidth": 110,
"proseWrap": "always"
}
...@@ -21,9 +21,11 @@ zstyle -s ':omz:update' mode update_mode || { ...@@ -21,9 +21,11 @@ zstyle -s ':omz:update' mode update_mode || {
# Cancel update if: # Cancel update if:
# - the automatic update is disabled. # - the automatic update is disabled.
# - the current user doesn't have write permissions nor owns the $ZSH directory. # - 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. # - git is unavailable on the system.
if [[ "$update_mode" = disabled ]] \ if [[ "$update_mode" = disabled ]] \
|| [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \ || [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \
|| [[ ! -t 1 ]] \
|| ! command git --version 2>&1 >/dev/null; then || ! command git --version 2>&1 >/dev/null; then
unset update_mode unset update_mode
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment