mirror of
https://github.com/zdharma-continuum/zinit-annex-bin-gem-node.git
synced 2026-09-10 07:26:18 -04:00
This reverts commit 0fe8fec773.
This commit is contained in:
parent
0fe8fec773
commit
1b8dca1809
|
|
@ -4,9 +4,7 @@
|
|||
za-bgn-atclone-handler() {
|
||||
|
||||
emulate -RL zsh
|
||||
setopt extendedglob warncreateglobal typesetsilent noshortloops nopromptsubst
|
||||
|
||||
0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}
|
||||
setopt extendedglob warncreateglobal typesetsilent noshortloops
|
||||
|
||||
if [[ "$1" = plugin ]] {
|
||||
local type="$1" user="$2" plugin="$3" id_as="$4" dir="${5#%}" hook="$6"
|
||||
|
|
@ -44,7 +42,7 @@ if [[ -n "${ICE[gem]}" ]] {
|
|||
command gem install -q --no-user-install -i "$dir" "${gems[@]}"
|
||||
elif [[ $hook = *atpull-<-> ]]; then
|
||||
if (( !OPTS[opt_-q,--quiet] )) {
|
||||
m {pre}bin-gem-node annex: {msg2}Updating the gems...
|
||||
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 {
|
||||
command gem update -q --no-user-install -i "$dir" "${gems[@]}" &> /dev/null
|
||||
|
|
@ -88,10 +86,9 @@ if [[ -n "${ICE[pip]}" ]] {
|
|||
|
||||
(( perform_update )) && (( ${#umods} )) && \
|
||||
(
|
||||
local -x VIRTUALENV
|
||||
builtin cd -q "$dir" && {
|
||||
if (( !OPTS[opt_-q,--quiet] )) {
|
||||
m {pre}bin-gem-node annex: {msg2}Updating the pip packages...
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{154}Updating the pip packages...%f"
|
||||
VIRTUALENV=venv(:A) command venv/bin/pip install --upgrade "${umods[@]}"
|
||||
} else {
|
||||
VIRTUALENV=venv(:A) command venv/bin/pip install -q --upgrade "${umods[@]}"
|
||||
|
|
@ -136,7 +133,7 @@ if [[ -n "${ICE[node]}" ]] {
|
|||
(
|
||||
builtin cd -q "$dir" && {
|
||||
if (( !OPTS[opt_-q,--quiet] )) {
|
||||
m {pre}bin-gem-node annex: {msg2}Updating the node modules...
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{154}Updating the node modules...%f"
|
||||
command npm --silent update
|
||||
} else {
|
||||
command npm --silent update &> /dev/null
|
||||
|
|
@ -181,12 +178,13 @@ if (( ${+ICE[sbin]} )) {
|
|||
if (( ${#files} )); then
|
||||
sbin="${files[1]}"
|
||||
else
|
||||
m {pre}bin-gem-node annex: {error}The automatic-empty sbin ice didn\'t find any executable files
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{160}The automatic-empty sbin ice didn't find any executable files%f"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Allow multiple separators, =>,->,→
|
||||
srcdst=( ${(@s.=>.)${(@s.→.)${(@s.->.)sbin}}} )
|
||||
srcdst=( "${srcdst[@]//((#s)[[:space:]]##|[[:space:]]##(#e))/}" )
|
||||
[[ ${srcdst[1]} = [1gnpcNEO]#g[1gnpcNEO]#:* ]] && set_gem_home=1
|
||||
|
|
@ -211,8 +209,7 @@ if (( ${+ICE[sbin]} )) {
|
|||
eval "fnames=( ${srcdst[1]}(Nnon-.) )"
|
||||
fi
|
||||
if (( !${#fnames} )) {
|
||||
m {pre}bin-gem-node annex: {error}Warning: {msg2}The sbin\'\' \
|
||||
ice \(\`{ice}$sbin{msg2}'\) didn\'t match any files
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{160}Warning: %F{154}The sbin'' ice (\`%F{219}$sbin%F{154}') didn't match any files%f"
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
@ -234,7 +231,7 @@ if (( ${+ICE[sbin]} )) {
|
|||
command chmod +x "$file.cmd"
|
||||
continue
|
||||
fi
|
||||
|
||||
|
||||
.za-bgn-bin-or-src-function-body 0 \
|
||||
"$fnam" \
|
||||
"$target_binary" "$dir" "$set_gem_home" \
|
||||
|
|
@ -249,13 +246,13 @@ if (( ${+ICE[sbin]} )) {
|
|||
(( !OPTS[opt_-q,--quiet] )) && \
|
||||
if [[ -x $target_binary ]]; then
|
||||
if [[ $hook == atclone-<-> || $ZINIT[annex-multi-flag:pull-active] -ge 2 ]] {
|
||||
m {pre}bin-gem-node annex: {msg2}${${${hook:#*atclone-<->}:+Re-c}:-C}reated the {cmd}$fnam{msg2} shim and set +x on the {cmd}${target_binary:t}{msg2} binary
|
||||
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"
|
||||
}
|
||||
else
|
||||
m {pre}bin-gem-node annex: {msg2}${${${hook:#*atclone-<->}:+Re-c}:-C}reated the {cmd}$fnam{msg2} shim {error}however the {cmd}${target_binary:t}{error} binary does not exist or failed to set +x on it
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{154}${${${hook:#*atclone-<->}:+Re-c}:-C}reated the %F{219}$fnam%F{154} shim %F{160}however the %F{219}${target_binary:t}%F{160} binary does not exist or failed to set +x on it%f"
|
||||
fi
|
||||
else
|
||||
m {pre}bin-gem-node annex: {error}Something went wrong creating the {cmd}$fnam{error} shim
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{160}Something went wrong creating the %F{219}$fnam%F{160} shim%f"
|
||||
fi
|
||||
if ((use_1)); then
|
||||
(($#fnames-1)) && \
|
||||
|
|
@ -290,9 +287,9 @@ if [[ -n "${ICE[fbin]}" ]] {
|
|||
|
||||
if [[ -x $target_binary ]]; then
|
||||
(( !OPTS[opt_-q,--quiet] )) && \
|
||||
m {pre}bin-gem-node annex: {msg2}Set +x on the {cmd}${target_binary:t}{msg2} binary
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{154}Set +x on the %F{219}${target_binary:t}%F{154} binary%f"
|
||||
else
|
||||
m {pre}bin-gem-node annex: {error}Something went wrong setting +x on the {cmd}${target_binary:t}{error} binary
|
||||
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"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
# Copyright (c) 2019-2020 Sebastian Gniazdowski
|
||||
# License MIT
|
||||
|
||||
za-bgn-atdelete-handler() {
|
||||
|
||||
emulate -RL zsh
|
||||
setopt extendedglob warncreateglobal typesetsilent noshortloops nopromptsubst
|
||||
|
||||
0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}
|
||||
setopt extendedglob warncreateglobal typesetsilent noshortloops
|
||||
|
||||
[[ "$1" = plugin ]] && \
|
||||
local type="$1" user="$2" plugin="$3" id_as="$4" dir="$5" hook="$6" || \
|
||||
|
|
@ -41,7 +37,7 @@ if (( ${+ICE[sbin]} )) {
|
|||
if (( ${#files} )); then
|
||||
sbin="${files[1]}"
|
||||
else
|
||||
m {pre}bin-gem-node annex: {error}The automatic-empty sbin ice didn\'t find any executable files
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{160}The automatic-empty sbin ice didn't find any executable files%f"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
|
|
@ -71,17 +67,16 @@ if (( ${+ICE[sbin]} )) {
|
|||
if [[ -f $file ]]; then
|
||||
command rm -f "$file"
|
||||
if [[ -f $file ]]; then
|
||||
m {pre}bin-gem-node annex: {error}Couldn\'t remove the {cmd}$fnam{error} shim from {dir}\$ZPFX/bin{error} \(no write access to {dir}\$ZPFX/bin{error}?\)
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{160}Couldn't remove the %F{220}$fnam%F{160} shim from \$ZPFX/bin (no write access to \$ZPFX/bin?)%f"
|
||||
else
|
||||
m {pre}bin-gem-node annex: {msg2}Correctly removed the {cmd}$fnam{msg2} shim from {dir}\$ZPFX/bin
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{154}Correctly removed the %F{220}$fnam%F{154} shim from \$ZPFX/bin%f" || \
|
||||
fi
|
||||
else
|
||||
m {pre}bin-gem-node annex: {error}The {cmd}$fnam{error} shim didn\'t exist in {dir}\$ZPFX/bin{error} (or isn\'t a regular file)
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{160}The %F{220}$fnam%F{160} shim didn't exist in \$ZPFX/bin (or isn't a regular file)%f"
|
||||
fi
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
# vim:ft=zsh:sw=4:sts=4:et
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@
|
|||
za-bgn-atload-handler() {
|
||||
|
||||
emulate -RL zsh
|
||||
setopt extendedglob warncreateglobal typesetsilent noshortloops nopromptsubst
|
||||
|
||||
0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}
|
||||
setopt extendedglob warncreateglobal typesetsilent noshortloops
|
||||
|
||||
if [[ "$1" = plugin ]] {
|
||||
local type="$1" user="$2" plugin="$3" id_as="$4" dir="${5#%}" hook="$6"
|
||||
|
|
@ -152,9 +150,7 @@ if (( ${+ICE[fbin]}${+ICE[fsrc]}${+ICE[ferc]} > 0 )) {
|
|||
if (( ${#files} )); then
|
||||
fbin="${files[1]}"
|
||||
else
|
||||
m {pre}bin-gem-node annex: {error}The automatic-empty \
|
||||
{ice}fbin{error} ice didn\'t find any executable \
|
||||
files for {id-as}$id_as
|
||||
print -P -- "%F{38}bin-gem-node annex: %F{160}The automatic-empty fbin ice didn't find any executable files for %F{219}$id_as%f"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -11,12 +11,10 @@
|
|||
za-bgn-shim-list() {
|
||||
|
||||
emulate -LR zsh
|
||||
setopt extendedglob warncreateglobal typesetsilent \
|
||||
noshortloops rcquotes nopromptsubst
|
||||
setopt extended_glob warn_create_global typeset_silent \
|
||||
no_short_loops rc_quotes
|
||||
|
||||
0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}
|
||||
|
||||
autoload -Uz is-at-least
|
||||
autoload is-at-least
|
||||
local is_58
|
||||
is-at-least 5.8 && is_58=1
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue