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
|
fi
|
||||||
|
|
||||||
provided_version=$1
|
provided_version=$1
|
||||||
|
|
||||||
if [ -z "$provided_version" ]; then
|
if [ -z "$provided_version" ]; then
|
||||||
if [ $version_not_provided -ne 1 ]; then
|
if [ $version_not_provided -ne 1 ]; then
|
||||||
nvm_rc_version
|
nvm_rc_version
|
||||||
fi
|
fi
|
||||||
provided_version="$NVM_RC_VERSION"
|
provided_version="$NVM_RC_VERSION"
|
||||||
|
else
|
||||||
|
shift
|
||||||
fi
|
fi
|
||||||
[ -d "$(nvm_version_path "$provided_version")" ] && echo "$provided_version is already installed." >&2 && return
|
[ -d "$(nvm_version_path "$provided_version")" ] && echo "$provided_version is already installed." >&2 && return
|
||||||
|
|
||||||
VERSION=`nvm_remote_version $provided_version`
|
VERSION=`nvm_remote_version $provided_version`
|
||||||
ADDITIONAL_PARAMETERS=''
|
ADDITIONAL_PARAMETERS=''
|
||||||
|
|
||||||
shift
|
|
||||||
|
|
||||||
while [ $# -ne 0 ]
|
while [ $# -ne 0 ]
|
||||||
do
|
do
|
||||||
ADDITIONAL_PARAMETERS="$ADDITIONAL_PARAMETERS $1"
|
ADDITIONAL_PARAMETERS="$ADDITIONAL_PARAMETERS $1"
|
||||||
|
|
Loading…
Reference in New Issue