mirror of
https://github.com/lukechilds/zsh-nvm.git
synced 2025-01-30 09:47:14 +08:00
Fix leaking variables using local
with for loops (#98)
This commit is contained in:
parent
e293a0914f
commit
d3db5265b5
@ -98,11 +98,13 @@ _zsh_nvm_lazy_load() {
|
|||||||
# Remove any binaries that conflict with current aliases
|
# Remove any binaries that conflict with current aliases
|
||||||
local cmds
|
local cmds
|
||||||
cmds=()
|
cmds=()
|
||||||
|
local bin
|
||||||
for bin in $global_binaries; do
|
for bin in $global_binaries; do
|
||||||
[[ "$(which $bin 2> /dev/null)" = "$bin: aliased to "* ]] || cmds+=($bin)
|
[[ "$(which $bin 2> /dev/null)" = "$bin: aliased to "* ]] || cmds+=($bin)
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create function for each command
|
# Create function for each command
|
||||||
|
local cmd
|
||||||
for cmd in $cmds; do
|
for cmd in $cmds; do
|
||||||
|
|
||||||
# When called, unset all lazy loaders, load nvm then run current command
|
# When called, unset all lazy loaders, load nvm then run current command
|
||||||
|
Loading…
Reference in New Issue
Block a user