install: Ensure that if a version is not provided, we don't try to shift a nonexistent argument.
parent
f8054d5cae
commit
4c948cf422
5
nvm.sh
5
nvm.sh
|
@ -433,19 +433,20 @@ nvm() {
|
|||
fi
|
||||
|
||||
provided_version=$1
|
||||
|
||||
if [ -z "$provided_version" ]; then
|
||||
if [ $version_not_provided -ne 1 ]; then
|
||||
nvm_rc_version
|
||||
fi
|
||||
provided_version="$NVM_RC_VERSION"
|
||||
else
|
||||
shift
|
||||
fi
|
||||
[ -d "$(nvm_version_path "$provided_version")" ] && echo "$provided_version is already installed." >&2 && return
|
||||
|
||||
VERSION=`nvm_remote_version $provided_version`
|
||||
ADDITIONAL_PARAMETERS=''
|
||||
|
||||
shift
|
||||
|
||||
while [ $# -ne 0 ]
|
||||
do
|
||||
ADDITIONAL_PARAMETERS="$ADDITIONAL_PARAMETERS $1"
|
||||
|
|
Loading…
Reference in New Issue