Skip to content

Commit 745291d

Browse files
author
Sumit Sahrawat
authored
Fix leaking variables using local with for loops (lukechilds#98)
1 parent 9295d10 commit 745291d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

zsh-nvm.plugin.zsh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,13 @@ _zsh_nvm_lazy_load() {
9898
# Remove any binaries that conflict with current aliases
9999
local cmds
100100
cmds=()
101+
local bin
101102
for bin in $global_binaries; do
102103
[[ "$(which $bin 2> /dev/null)" = "$bin: aliased to "* ]] || cmds+=($bin)
103104
done
104105

105106
# Create function for each command
107+
local cmd
106108
for cmd in $cmds; do
107109

108110
# When called, unset all lazy loaders, load nvm then run current command

0 commit comments

Comments
 (0)