diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cli.zsh | 8 | ||||
-rw-r--r-- | lib/functions.zsh | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/cli.zsh b/lib/cli.zsh index 38cdc449c..92d447a8e 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -376,13 +376,19 @@ function _omz::theme::use { function _omz::update { # Run update script - env ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" + if [[ "$1" != --unattended ]]; then + ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive + else + ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" + fi local ret=$? + # Update last updated file zmodload zsh/datetime echo "LAST_EPOCH=$(( EPOCHSECONDS / 60 / 60 / 24 ))" >! "${ZSH_CACHE_DIR}/.zsh-update" # Remove update lock if it exists command rm -rf "$ZSH/log/update.lock" + # Restart the zsh session if [[ $ret -eq 0 && "$1" != --unattended ]]; then # Check whether to run a login shell diff --git a/lib/functions.zsh b/lib/functions.zsh index b0582b32b..0fc758070 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -14,7 +14,7 @@ function upgrade_oh_my_zsh() { fi # Run update script - env ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" + env ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" --interactive local ret=$? # Update last updated file zmodload zsh/datetime |