mirror of
https://github.com/zdharma-continuum/zinit-annex-rust.git
synced 2026-09-10 04:36:14 -04:00
refactor: rename zinit functions
This commit is contained in:
parent
1f761fa80c
commit
0a6f4de3c6
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue