Do not modify parameters of sourcing script in zsh

When sourcing a script without parameters in zsh the sourced scripts
gets the same parameters as the sourcing file and is able to modify
these parameters. Prevent nvm from removing all parameters of sourcing
script by processing a copy of the parameters in a function.
This commit is contained in:
Jonas Dohse
2016-02-15 12:49:56 +01:00
parent dc9020b133
commit 7135873f80
2 changed files with 24 additions and 13 deletions

View File

@@ -0,0 +1,5 @@
#!/bin/sh
set -- yes
. ../../nvm.sh
[ "$1" = yes ]