Skip to content

Commit

Permalink
refactor: rename zinit functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vladdoster committed Dec 9, 2022
1 parent 1f761fa commit dc32485
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions z-a-rust.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ autoload .za-rust-bin-or-src-function-body \
# An empty stub to fill the help handler fields
za-rust-help-null-handler() { :; }

@zinit-register-annex "zinit-annex-rust" \
@zi::register-annex "zinit-annex-rust" \
hook:atload-40 \
za-rust-atload-handler \
za-rust-help-handler \
"rustup|cargo''" # also register new ices

@zinit-register-annex "zinit-annex-rust" \
@zi::register-annex "zinit-annex-rust" \
hook:atclone-40 \
za-rust-atclone-handler \
za-rust-help-null-handler

@zinit-register-annex "zinit-annex-rust" \
@zi::register-annex "zinit-annex-rust" \
hook:\%atpull-40 \
za-rust-atclone-handler \
za-rust-help-null-handler

@zinit-register-annex "zinit-annex-rust" \
@zi::register-annex "zinit-annex-rust" \
hook:atdelete-40 \
za-rust-atdelete-handler \
za-rust-help-null-handler
Expand Down
12 changes: 6 additions & 6 deletions za-rust-atclone-handler
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ fi

local nl=$'\n'

# FUNCTION: .zinit-annex-rust-download-file-stdout [[[
# FUNCTION: _zi::annex-rust-download-file-stdout [[[
# Downloads file to stdout. Supports following backend commands:
# curl, wget, lftp, lynx. Used by snippet loading.
.zinit-annex-rust-download-file-stdout() {
_zi::annex-rust-download-file-stdout() {
local url="$1" restart="$2"

setopt localoptions localtraps
Expand Down Expand Up @@ -53,7 +53,7 @@ local nl=$'\n'
elif type lftp 2>/dev/null 1>&2; then
command lftp -c "cat $url" || return 1
else
.zinit-annex-rust-download-file-stdout "$url" "1"
_zi::annex-rust-download-file-stdout "$url" "1"
return $?
fi
fi
Expand All @@ -69,9 +69,9 @@ if (( ${+ICE[rustup]} )) {
return 1
}
command mkdir -p bin rustup
.zinit-annex-rust-download-file-stdout 'https://sh.rustup.rs' 0 >! bin/rustup-init || \
_zi::annex-rust-download-file-stdout 'https://sh.rustup.rs' 0 >! bin/rustup-init || \
{
.zinit-annex-rust-download-file-stdout 'https://sh.rustup.rs' 1 >! bin/rustup-init || \
_zi::annex-rust-download-file-stdout 'https://sh.rustup.rs' 1 >! bin/rustup-init || \
{
print -P -- "%F{38}rust annex: %F{198}Couldn't download the %F{220}rustup.rs%F{198} installer%f"
return 0
Expand Down Expand Up @@ -228,7 +228,7 @@ if [[ -n "${ICE[cargo]}" ]] {
if [[ -x $file ]]; then
if (( !OPTS[opt_-q,--quiet] )); then
if [[ $hook == atclone-<-> || $ZINIT[annex-multi-flag:pull-active] -ge 1 ]]; then
+zinit-message "{pre}rust annex: {data2}${${hook:#*atclone-<->}:+Re-}Created the {file}$fnam{data2} shim.{rst}"
+zi::message "{pre}rust annex: {data2}${${hook:#*atclone-<->}:+Re-}Created the {file}$fnam{data2} shim.{rst}"
fi
fi
else
Expand Down

0 comments on commit dc32485

Please sign in to comment.