fix: use +zinit-message for logging (#10)

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>

Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
This commit is contained in:
vladislav doster 2023-01-07 23:17:46 -06:00 committed by GitHub
parent 6f2d509b17
commit 4fba9d16b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 5 deletions

View file

@ -1,5 +1,8 @@
#!/usr/bin/env zsh
#
# In accordance with the Zsh Plugin Standard
# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html
#
0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}"
0="${${(M)0:#/*}:-$PWD/$0}"
@ -10,13 +13,15 @@ autoload -Uz za-patch-dl-handler
za-patch-dl-help-null-handler() { :; }
# Register !atclone hook
@zinit-register-annex "zinit-annex-patch-dl" hook:\!atclone-20 \
@zinit-register-annex "zinit-annex-patch-dl" \
hook:\!atclone-20 \
za-patch-dl-handler \
za-patch-dl-help-null-handler \
"dl''|patch''" # register a new ice-mod: test''
# Register !atpull hook
@zinit-register-annex "zinit-annex-patch-dl" hook:\!atpull-20 \
@zinit-register-annex "zinit-annex-patch-dl" \
hook:\!atpull-20 \
za-patch-dl-handler \
za-patch-dl-help-null-handler

View file

@ -77,13 +77,13 @@ if [[ -n ${ICE[dl]} && ${ICE[dl]} != ink=[-/[:alnum:]]* ]]; then
if ! .zinit-annex-patch-dl-download-file-stdout "${srcdst[1]}" >! "$tdir/$tl"; then
if ! .zinit-annex-patch-dl-download-file-stdout "${srcdst[1]}" 1 >! "$tdir/$tl"; then
print -P -- "%F{38}[patch-dl annex]: %F{160}Failed to download the URL %F{220}${srcdst[1]}%f"
+zinit-message "{info}[{pre}patch-dl annex{info}]{error} Failed to download the URL {glob}${srcdst[1]}{rst}"
ret=1
fi
fi
if (( !ret && !OPTS[opt_-q,--quiet] && ZINIT[annex-multi-flag:pull-active] == 2 )); then
print -P -- "%F{38}[patch-dl annex]: %F{154}File %F{220}$tl%F{154} downloaded correctly%f"
+zinit-message "{info}[{pre}patch-dl annex{info}] {file}${tl}{rst} downloaded successfully"
fi
}
fi
@ -98,7 +98,7 @@ if [[ -n "${ICE[patch]}" ]]; then
@zinit-substitute pch
if (( !OPTS[opt_-q,--quiet] && ZINIT[annex-multi-flag:pull-active] == 2 )); then
print -P -- "%F{38}[patch-dl annex]: %F{154}Applying patch %F{220}$pch...%f"
+zinit-message "{info}[{pre}patch-dl annex{info}]{rst} Applying patch {pname}${pch}{rst}"
fi
(