mirror of
https://github.com/zdharma-continuum/zinit-annex-bin-gem-node.git
synced 2026-09-10 07:26:18 -04:00
Rename variables.
This commit is contained in:
parent
2c4b69708b
commit
a6f79017ca
|
|
@ -14,9 +14,9 @@ if [[ "$1" = plugin ]] {
|
|||
|
||||
local nl=$'\n'
|
||||
|
||||
if [[ -n "${ZINIT_ICE[gem]}" ]] {
|
||||
if [[ -n "${ICE[gem]}" ]] {
|
||||
local -a gem_defs srcdst tmpsdst gems
|
||||
gem_defs=( "${(s.;.)ZINIT_ICE[gem]}" )
|
||||
gem_defs=( "${(s.;.)ICE[gem]}" )
|
||||
|
||||
local gem
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ if [[ -n "${ZINIT_ICE[gem]}" ]] {
|
|||
if [[ $hook = *atclone-<-> ]]; then
|
||||
command gem install -q --no-user-install -i "$dir" "${gems[@]}"
|
||||
elif [[ $hook = *atpull-<-> ]]; then
|
||||
if (( !ICE_OPTS[opt_-q,--quiet] )) {
|
||||
if (( !OPTS[opt_-q,--quiet] )) {
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{154}Updating the gems...%f"
|
||||
command gem update -q --no-user-install -i "$dir" "${gems[@]}"
|
||||
} else {
|
||||
|
|
@ -51,9 +51,9 @@ if [[ -n "${ZINIT_ICE[gem]}" ]] {
|
|||
}
|
||||
}
|
||||
|
||||
if [[ -n "${ZINIT_ICE[node]}" ]] {
|
||||
if [[ -n "${ICE[node]}" ]] {
|
||||
local -a node_defs srcdst tmpsdst mods
|
||||
node_defs=( "${(s.;.)ZINIT_ICE[node]}" )
|
||||
node_defs=( "${(s.;.)ICE[node]}" )
|
||||
|
||||
local node
|
||||
integer perform_update=0
|
||||
|
|
@ -86,7 +86,7 @@ if [[ -n "${ZINIT_ICE[node]}" ]] {
|
|||
(( perform_update )) && \
|
||||
(
|
||||
builtin cd -q "$dir" && {
|
||||
if (( !ICE_OPTS[opt_-q,--quiet] )) {
|
||||
if (( !OPTS[opt_-q,--quiet] )) {
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{154}Updating the node modules...%f"
|
||||
command npm --silent update
|
||||
} else {
|
||||
|
|
@ -100,9 +100,9 @@ if [[ -n "${ZINIT_ICE[node]}" ]] {
|
|||
# sbin'' ice – creation of shims (the name borrowed from rbenv)
|
||||
#
|
||||
|
||||
if (( ${+ZINIT_ICE[sbin]} )) {
|
||||
if (( ${+ICE[sbin]} )) {
|
||||
local -a sbins srcdst
|
||||
sbins=( ${(s.;.)ZINIT_ICE[sbin]} )
|
||||
sbins=( ${(s.;.)ICE[sbin]} )
|
||||
|
||||
local sbin
|
||||
|
||||
|
|
@ -186,7 +186,7 @@ if (( ${+ZINIT_ICE[sbin]} )) {
|
|||
command chmod +x "$file" "$target_binary"
|
||||
|
||||
if [[ -x $file ]]; then
|
||||
(( !ICE_OPTS[opt_-q,--quiet] )) && \
|
||||
(( !OPTS[opt_-q,--quiet] )) && \
|
||||
if [[ -x $target_binary ]]; then
|
||||
if [[ $hook == atclone-<-> || $ZINIT[annex-multi-flag:pull-active] -ge 2 ]] {
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{154}${${${hook:#*atclone-<->}:+Re-c}:-C}reated the %F{219}$fnam%F{154} shim and set +x on the %F{219}${target_binary:t}%F{154} binary%f"
|
||||
|
|
@ -202,9 +202,9 @@ if (( ${+ZINIT_ICE[sbin]} )) {
|
|||
)
|
||||
}
|
||||
|
||||
if [[ -n "${ZINIT_ICE[fbin]}" ]] {
|
||||
if [[ -n "${ICE[fbin]}" ]] {
|
||||
local -a fbins srcdst
|
||||
fbins=( "${(s.;.)ZINIT_ICE[fbin]}" )
|
||||
fbins=( "${(s.;.)ICE[fbin]}" )
|
||||
|
||||
local fbin
|
||||
|
||||
|
|
@ -221,7 +221,7 @@ if [[ -n "${ZINIT_ICE[fbin]}" ]] {
|
|||
command chmod +x "$target_binary"
|
||||
|
||||
if [[ -x $target_binary ]]; then
|
||||
(( !ICE_OPTS[opt_-q,--quiet] )) && \
|
||||
(( !OPTS[opt_-q,--quiet] )) && \
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{154}Set +x on the %F{219}${target_binary:t}%F{154} binary%f"
|
||||
else
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{160}Something went wrong setting +x on the %F{219}${target_binary:t}%F{160} binary%f"
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ local nl=$'\n'
|
|||
# sbin'' ice – creation of shims (the name borrowed from rbenv)
|
||||
#
|
||||
|
||||
if (( ${+ZINIT_ICE[sbin]} )) {
|
||||
if (( ${+ICE[sbin]} )) {
|
||||
local -a sbins srcdst
|
||||
sbins=( ${(s.;.)ZINIT_ICE[sbin]} )
|
||||
sbins=( ${(s.;.)ICE[sbin]} )
|
||||
|
||||
local sbin
|
||||
integer set_gem_home set_node_path
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ local nl=$'\n'
|
|||
# gem'' ice
|
||||
#
|
||||
|
||||
if [[ -n "${ZINIT_ICE[gem]}" ]] {
|
||||
if [[ -n "${ICE[gem]}" ]] {
|
||||
local -a gems srcdst tmpsdst
|
||||
gems=( "${(s.;.)ZINIT_ICE[gem]}" )
|
||||
gems=( "${(s.;.)ICE[gem]}" )
|
||||
|
||||
local gem
|
||||
integer add_fbin
|
||||
|
|
@ -42,7 +42,7 @@ if [[ -n "${ZINIT_ICE[gem]}" ]] {
|
|||
|
||||
if (( add_fbin )); then
|
||||
local target_binary="g:$dir/bin/${srcdst[1]}"
|
||||
ZINIT_ICE[fbin]+="${ZINIT_ICE[fbin]:+;}$target_binary -> ${srcdst[3]}"
|
||||
ICE[fbin]+="${ICE[fbin]:+;}$target_binary -> ${srcdst[3]}"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
|
@ -51,9 +51,9 @@ if [[ -n "${ZINIT_ICE[gem]}" ]] {
|
|||
# node'' ice
|
||||
#
|
||||
|
||||
if [[ -n "${ZINIT_ICE[node]}" ]] {
|
||||
if [[ -n "${ICE[node]}" ]] {
|
||||
local -a nodes srcdst tmpsdst
|
||||
nodes=( "${(s.;.)ZINIT_ICE[node]}" )
|
||||
nodes=( "${(s.;.)ICE[node]}" )
|
||||
|
||||
local node
|
||||
integer add_fbin
|
||||
|
|
@ -75,7 +75,7 @@ if [[ -n "${ZINIT_ICE[node]}" ]] {
|
|||
|
||||
if (( add_fbin )); then
|
||||
local target_binary="n:$dir/node_modules/.bin/${srcdst[1]}"
|
||||
ZINIT_ICE[fbin]+="${ZINIT_ICE[fbin]:+;}$target_binary -> ${srcdst[3]}"
|
||||
ICE[fbin]+="${ICE[fbin]:+;}$target_binary -> ${srcdst[3]}"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
|
@ -85,11 +85,11 @@ if [[ -n "${ZINIT_ICE[node]}" ]] {
|
|||
# or node modules
|
||||
#
|
||||
|
||||
if (( ${+ZINIT_ICE[fbin]}${+ZINIT_ICE[fsrc]}${+ZINIT_ICE[ferc]} > 0 )) {
|
||||
if (( ${+ICE[fbin]}${+ICE[fsrc]}${+ICE[ferc]} > 0 )) {
|
||||
local -a fbins fsrcs fercs srcdst
|
||||
fbins=( ${(s.;.)ZINIT_ICE[fbin]} )
|
||||
fsrcs=( ${(s.;.)ZINIT_ICE[fsrc]} )
|
||||
fercs=( ${(s.;.)ZINIT_ICE[ferc]} )
|
||||
fbins=( ${(s.;.)ICE[fbin]} )
|
||||
fsrcs=( ${(s.;.)ICE[fsrc]} )
|
||||
fercs=( ${(s.;.)ICE[ferc]} )
|
||||
|
||||
local fbin
|
||||
integer run_type=0
|
||||
|
|
@ -101,9 +101,9 @@ if (( ${+ZINIT_ICE[fbin]}${+ZINIT_ICE[fsrc]}${+ZINIT_ICE[ferc]} > 0 )) {
|
|||
[[ "$fbin" = "<sep1>" ]] && { run_type=1; continue; }
|
||||
[[ "$fbin" = "<sep2>" ]] && { run_type=2; continue; }
|
||||
|
||||
if [[ ( ${+ZINIT_ICE[fbin]} -eq 1 && run_type -eq 0 && -z $fbin && ${#fbins} -eq 0 ) || \
|
||||
( ${+ZINIT_ICE[fsrc]} -eq 1 && run_type -eq 1 && -z $fbin && ${#fsrcs} -eq 0 ) || \
|
||||
( ${+ZINIT_ICE[ferc]} -eq 1 && run_type -eq 2 && -z $fbin && ${#fercs} -eq 0 )
|
||||
if [[ ( ${+ICE[fbin]} -eq 1 && run_type -eq 0 && -z $fbin && ${#fbins} -eq 0 ) || \
|
||||
( ${+ICE[fsrc]} -eq 1 && run_type -eq 1 && -z $fbin && ${#fsrcs} -eq 0 ) || \
|
||||
( ${+ICE[ferc]} -eq 1 && run_type -eq 2 && -z $fbin && ${#fercs} -eq 0 )
|
||||
]]; then
|
||||
if [[ -f $dir/${id_as:t} ]]; then
|
||||
fbin="$dir/${id_as:t}"
|
||||
|
|
@ -153,9 +153,9 @@ if (( ${+ZINIT_ICE[fbin]}${+ZINIT_ICE[fsrc]}${+ZINIT_ICE[ferc]} > 0 )) {
|
|||
# fmod'' ice
|
||||
#
|
||||
|
||||
if [[ -n "${ZINIT_ICE[fmod]}" ]] {
|
||||
if [[ -n "${ICE[fmod]}" ]] {
|
||||
local -a fmods srcdst
|
||||
fmods=( "${(s.;.)ZINIT_ICE[fmod]}" )
|
||||
fmods=( "${(s.;.)ICE[fmod]}" )
|
||||
|
||||
local fmod
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue