Skip to content

Commit

Permalink
fix: consistent log prefix
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Doster <[email protected]>
  • Loading branch information
vladdoster committed Dec 24, 2023
1 parent 2f86d05 commit c6385fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions :za-lb-atclone-handler
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fi

if (( ${+ICE[lbin]} )); then
if (( ${+ICE[sbin]} )); then
+zi-log "{m} {b}linkbin annex{rst}: {ice}sbin{rst} ice detected, not doing anything"
+zi-log "{m} {b}linkbin{rst}: {ice}sbin{rst} ice detected, not doing anything"
return 0
fi
(
Expand All @@ -41,7 +41,7 @@ if (( ${+ICE[lbin]} )); then
(7) [[ -n $plugin ]] && files=($dir/**/$plugin(Nnon.)) ;;
(8) [[ -n $url ]] && files=($dir/**/${url:t}(Nnon.)) ;;
(9) files=($dir/**/*(*Nnon.:t)) ;;
(10) +zi-log "{e} {b}linkbin annex{rst}: {ice}lbin{rst} ice did not detect any executable files" ;;
(10) +zi-log "{e} {b}linkbin{rst}: {ice}lbin{rst} ice did not detect any executable files" ;;
esac
done
[[ $i -gt 9 ]] && break
Expand All @@ -61,7 +61,7 @@ if (( ${+ICE[lbin]} )); then
eval "fnames=(${srcdst[1]}(Nnon-.))"
fi
if (( !${#fnames} )); then
+zi-log "{e} {b}linkbin annex{rst}: {ice}lbin{rst} ice ({glob}$lbin{rst}) did not match any files"
+zi-log "{e} {b}linkbin{rst}: {ice}lbin{rst} ice ({glob}$lbin{rst}) did not match any files"
continue
fi
for fname in $fnames; do
Expand All @@ -74,13 +74,13 @@ if (( ${+ICE[lbin]} )); then
if [[ -x $file ]]; then
if [[ -x $target_binary ]]; then
if (( !OPTS[opt_-q,--quiet] )) && [[ $hook == atclone-<-> || $ZINIT[annex-multi-flag:pull-active] -ge 1 ]]; then
+zi-log "{m} {b}linkbin annex{rst}: ${${${hook:#*atclone-<->}:+Re-c}:-C}reated {file}$fnam{rst} ${${${sym#-P}:+soft}:-hard} link & set +x on the {file}${target_binary:t}{rst} binary"
+zi-log "{m} {b}linkbin{rst}: ${${${hook:#*atclone-<->}:+Re-c}:-C}reated {file}$fnam{rst} ${${${sym#-P}:+soft}:-hard} link & set +x on the {file}${target_binary:t}{rst} binary"
fi
else
+zi-log "{m} {b}linkbin annex{rst}: ${${${hook:#*atclone-<->}:+Re-c}:-C}reated {file}$fnam{rst} ${${${sym#-P}:+soft}:-hard} link, but {file}${target_binary:t}{rst} binary does not exist or failed to set +x on it"
+zi-log "{m} {b}linkbin{rst}: ${${${hook:#*atclone-<->}:+Re-c}:-C}reated {file}$fnam{rst} ${${${sym#-P}:+soft}:-hard} link, but {file}${target_binary:t}{rst} binary does not exist or failed to set +x on it"
fi
else
+zi-log "{e} {b}linkbin annex{rst}: Failed to create {file}$fnam{rst} link"
+zi-log "{e} {b}linkbin{rst}: Failed to create {file}$fnam{rst} link"
fi
done
done
Expand Down
14 changes: 7 additions & 7 deletions :za-lb-atdelete-handler
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ fi

if (( ${+ICE[lbin]} )); then
# if (( ${+ICE[sbin]} || ${+ZINIT_ICE[sbin]} )); then
# +zi-log "{m} {b}linkbin annex{rst}: {ice}sbin{rst} ice detected, not doing anything"
# +zi-log "{m} {b}linkbin{rst}: {ice}sbin{rst} ice detected, not doing anything"
# return
# fi
if (( ${+ICE[sbin]} )); then
+zi-log "{m} {b}linkbin annex{rst}: {ice}sbin{rst} ice detected, not doing anything"
+zi-log "{m} {b}linkbin{rst}: {ice}sbin{rst} ice detected, not doing anything"
return 0
fi
local -a lbins srcdst
Expand All @@ -44,7 +44,7 @@ if (( ${+ICE[lbin]} )); then
(7) [[ -n $plugin ]] && files=($dir/**/$plugin(Nnon.)) ;;
(8) [[ -n $url ]] && files=($dir/**/${url:t}(Nnon.)) ;;
(9) files=($dir/**/*(*Nnon.:t)) ;;
(10) +zi-log "{e} {b}linkbin annex{rst}: {ice}lbin{rst} ice did not detect any executable files" ;;
(10) +zi-log "{e} {b}linkbin{rst}: {ice}lbin{rst} ice did not detect any executable files" ;;
esac
done
[[ $i -gt 9 ]] && break
Expand All @@ -64,7 +64,7 @@ if (( ${+ICE[lbin]} )); then
eval "fnames=(${srcdst[1]}(Nnon-.))"
fi
if (( !${#fnames} )); then
+zi-log "{e} {b}linkbin annex{rst}: The {ice}lbin{rst} ice ({glob}$lbin{rst}) did not match any files"
+zi-log "{e} {b}linkbin{rst}: The {ice}lbin{rst} ice ({glob}$lbin{rst}) did not match any files"
continue
fi
for fname in $fnames; do
Expand All @@ -74,12 +74,12 @@ if (( ${+ICE[lbin]} )); then
if [[ -f $file ]]; then
command rm "$file"
if ! [[ -f $file ]]; then
(( !OPTS[opt_-q,--quiet] )) && +zi-log "{m} {b}linkbin annex{rst}: Deleted {file}$fnam{rst} ${${${sym#-P}:+soft}:-hard} link"
(( !OPTS[opt_-q,--quiet] )) && +zi-log "{m} {b}linkbin{rst}: Deleted {file}$fnam{rst} ${${${sym#-P}:+soft}:-hard} link"
else
+zi-log "{e} {b}linkbin annex{rst}: Failed to delete {file}$fnam{rst} link"
+zi-log "{e} {b}linkbin{rst}: Failed to delete {file}$fnam{rst} link"
fi
else
+zi-log "{w} {b}linkbin annex{rst}: {file}$fnam{rst} ${${${sym#-P}:+soft}:-hard} link not found in \$ZPFX/bin"
+zi-log "{w} {b}linkbin{rst}: {file}$fnam{rst} ${${${sym#-P}:+soft}:-hard} link not found in \$ZPFX/bin"
fi
done
done
Expand Down

0 comments on commit c6385fc

Please sign in to comment.