@@ -1966,13 +1966,11 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
19661966#
19671967# $1 - Absolute path to Git repository"
19681968.zi-check-for-git-changes () {
1969- local quiet=0
1970- [[ $1 = -q ]] && { quiet=1; shift ; }
19711969 +zi-log " {dbg} checking $1 "
19721970 if command git -C " $1 " rev-parse --is-inside-work-tree & > /dev/null; then
19731971 if command git -C " $1 " rev-parse --abbrev-ref @' {u}' & > /dev/null; then
19741972 REPLY=$( command git -C " $1 " rev-parse --abbrev-ref HEAD)
1975- if (( ! quiet )) ; then
1973+ if (( ! OPTS[opt_ - q ,-- quiet] )) ; then
19761974 local nl=$' \n '
19771975 +zi-log -n " {pre}[self-update]{info} fetching latest changes from {obj}$REPLY {info} branch$nl {rst}"
19781976 fi
@@ -1983,7 +1981,7 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
19831981 return 0
19841982 fi
19851983 fi
1986- (( ! quiet )) && +zi-log " {m} Already up to date"
1984+ (( ! OPTS[opt_ - q ,-- quiet] )) && +zi-log " {m} Already up to date"
19871985 return 1
19881986 fi
19891987} # ]]]
@@ -1993,11 +1991,9 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
19931991 builtin emulate -LR zsh ${=${options[xtrace]:# off} : +-o xtrace}
19941992 setopt extendedglob typesetsilent warncreateglobal
19951993
1996- if .zi-check-for-git-changes ${1 : + " $1 " } " $ZINIT [BIN_DIR]" ; then
1994+ if .zi-check-for-git-changes " $ZINIT [BIN_DIR]" ; then
19971995 # Store branch name resolved by .zi-check-for-git-changes via $REPLY
19981996 local current_branch=$REPLY
1999-
2000- [[ $1 = -q ]] && +zi-log " {pre}[self-update]{info} updating zinit repository{msg2}" \
20011997
20021998 local nl=$' \n ' escape=$' \x1b ['
20031999 # Warn if user is not on main (requested by maintainer)
@@ -2025,21 +2021,21 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
20252021 builtin print
20262022 fi
20272023 # Do not use hardcoded 'origin main' to let git use the configured upstream
2028- if [[ $1 != -q ]] {
2024+ if (( ! OPTS[opt_ - q ,-- quiet] )) {
20292025 command git pull --no-stat --ff-only
20302026 } else {
20312027 command git pull --no-stat --quiet --ff-only
20322028 }
20332029 )
2034- if [[ $1 != -q ]] {
2030+ if (( ! OPTS[opt_ - q ,-- quiet] )) {
20352031 +zi-log " {pre}[self-update]{info} compiling zinit via {obj}zcompile{rst}"
20362032 }
20372033 command rm -f $ZINIT [BIN_DIR]/* .zwc(DN)
20382034 zcompile -U $ZINIT [BIN_DIR]/zinit.zsh
20392035 zcompile -U $ZINIT [BIN_DIR]/zinit-{' side' ,' install' ,' autoload' ,' additional' }.zsh
20402036 zcompile -U $ZINIT [BIN_DIR]/share/git-process-output.zsh
20412037 # Load for the current session
2042- [[ $1 != -q ]] && +zi-log " {pre}[self-update]{info} reloading zinit for the current session{rst}"
2038+ (( ! OPTS[opt_ - q ,-- quiet] )) && +zi-log " {pre}[self-update]{info} reloading zinit for the current session{rst}"
20432039
20442040 # +zi-log "{pre}[self-update]{info} resetting zinit repository via{rst}: {cmd}${ICE[reset]:-git reset --hard HEAD}{rst}"
20452041 source $ZINIT [BIN_DIR]/zinit.zsh
@@ -3402,7 +3398,9 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
34023398
34033399 local -F2 SECONDS=0
34043400
3405- .zinit-self-update -q
3401+ local -A OPTS
3402+ OPTS[opt_-q,--quiet]=1
3403+ .zinit-self-update
34063404
34073405 [[ $2 = restart ]] && \
34083406 +zi-log " {msg2}Restarting the update with the new codebase loaded.{rst}" $' \n '
0 commit comments