1aa2b18e293db8278a013322e42fd7aaa002a780

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

feat(CLI): add `--unattended` flag to `omz update` to not reload zsh (#9187)

Diff

 1diff --git a/lib/cli.zsh b/lib/cli.zsh
 2index 253c554c12017b7c776a693304b707c5bc104490..38cdc449c742bc1c25d3c9aa0422620a3a08ae05 100644
 3--- a/lib/cli.zsh
 4+++ b/lib/cli.zsh
 5@@ -384,7 +384,7 @@ function _omz::update {
 6   # Remove update lock if it exists
 7   command rm -rf "$ZSH/log/update.lock"
 8   # Restart the zsh session
 9-  if [[ $ret -eq 0 ]]; then
10+  if [[ $ret -eq 0 && "$1" != --unattended ]]; then
11     # Check whether to run a login shell
12     [[ "$ZSH_ARGZERO" = -* ]] && exec -l "${ZSH_ARGZERO#-}" || exec "$ZSH_ARGZERO"
13   fi