Skip to content

Commit

Permalink
feat: update output messaging to be more informative
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <[email protected]>
  • Loading branch information
vladdoster committed Apr 11, 2022
1 parent 23c47e1 commit 047320a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zinit-autoload.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -711,14 +711,14 @@ ZINIT[EXTENDED_GLOB]=""
emulate -LR zsh
setopt extendedglob typesetsilent warncreateglobal

[[ $1 = -q ]] && +zinit-message "{info2}Updating Zinit{…}{rst}"
[[ $1 = -q ]] && +zinit-message -n "{info2}[self-update]{info2}{msg2} Updating Zinit repository{msg2}" \

local nl=$'\n' escape=$'\x1b['
local current_branch=$(builtin pushd $ZINIT[BIN_DIR] > /dev/null && git branch --show-current && popd > /dev/null)
local -a lines
(
builtin cd -q "$ZINIT[BIN_DIR]" \
&& +zinit-message -n "{pre}[self-update]{msg2} fetching changes for {msg2}$current_branch$nl{cmd}" \
&& +zinit-message -n "{pre}[self-update]{msg2} fetching latest changes from {msg2}$current_branch$nl{cmd}" \
&& command git fetch --quiet \
&& lines=( ${(f)"$(command git log --color --date=short --pretty=format:'%Cgreen%cd %h %Creset%s %Cred%d%Creset || %b' ..FETCH_HEAD)"} )
if (( ${#lines} > 0 )); then
Expand All @@ -743,14 +743,14 @@ ZINIT[EXTENDED_GLOB]=""
}
)
if [[ $1 != -q ]] {
+zinit-message "Compiling Zinit (zcompile){…}"
+zinit-message -n "{pre}[self-update]{msg2} compiling zinit (zinit){msg2}"
}
command rm -f $ZINIT[BIN_DIR]/*.zwc(DN)
zcompile -U $ZINIT[BIN_DIR]/zinit.zsh
zcompile -U $ZINIT[BIN_DIR]/zinit-{'side','install','autoload','additional'}.zsh
zcompile -U $ZINIT[BIN_DIR]/share/git-process-output.zsh
# Load for the current session
[[ $1 != -q ]] && +zinit-message "Reloading Zinit for the current session{}"
[[ $1 != -q ]] && +zinit-message -n "{pre}[self-update]{msg2} Reloading Zinit for the current session{msg2}"
source $ZINIT[BIN_DIR]/zinit.zsh
zcompile -U $ZINIT[BIN_DIR]/zinit-{'side','install','autoload'}.zsh
# Read and remember the new modification timestamps
Expand Down

0 comments on commit 047320a

Please sign in to comment.