diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2022-05-23 12:25:11 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2022-05-23 12:25:11 -0600 |
commit | 901674e84756d64024cdc70f9590c3557c6d92d6 (patch) | |
tree | d3b90c50a39f4a7f220b0a19718dc305fe1c7af4 /tools | |
parent | 2023d3ab658fe8ed4dd4ca33cd5974ab8f0ad945 (diff) | |
parent | 39b600e9e564db3dec265fcf2e3db4b5568dd93a (diff) | |
download | zsh-901674e84756d64024cdc70f9590c3557c6d92d6.tar.gz zsh-901674e84756d64024cdc70f9590c3557c6d92d6.tar.bz2 zsh-901674e84756d64024cdc70f9590c3557c6d92d6.zip |
Merge remote-tracking branch 'github/master'
Diffstat (limited to 'tools')
-rw-r--r-- | tools/check_for_upgrade.sh | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index d3ad7582c..149500aa9 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -180,23 +180,17 @@ function has_typed_input() { return fi - # Don't ask for confirmation before updating if in auto mode - if [[ "$update_mode" = auto ]]; then - update_ohmyzsh - return $? - fi - - # If in reminder mode show reminder and exit - if [[ "$update_mode" = reminder ]]; then + # If in reminder mode or user has typed input, show reminder and exit + if [[ "$update_mode" = reminder ]] || has_typed_input; then + printf '\r\e[0K' # move cursor to first column and clear whole line echo "[oh-my-zsh] It's time to update! You can do that by running \`omz update\`" return 0 fi - # If user has typed input, show reminder and exit - if has_typed_input; then - echo - echo "[oh-my-zsh] It's time to update! You can do that by running \`omz update\`" - return 0 + # Don't ask for confirmation before updating if in auto mode + if [[ "$update_mode" = auto ]]; then + update_ohmyzsh + return $? fi # Ask for confirmation and only update on 'y', 'Y' or Enter |