[Fix] set -e: nvm install lts/something: call nvm_ensure_default_set with the proper value.

Fixes #1394.
This commit is contained in:
Jordan Harband
2017-02-11 23:14:58 -08:00
parent 1b2305232f
commit affcc5087c
2 changed files with 5 additions and 3 deletions

6
nvm.sh
View File

@@ -2460,7 +2460,11 @@ nvm() {
fi
if [ "$NVM_INSTALL_SUCCESS" = true ] && nvm use "$VERSION"; then
nvm_ensure_default_set "$provided_version"
if [ -n "${LTS-}" ]; then
nvm_ensure_default_set "lts/${LTS}"
else
nvm_ensure_default_set "$provided_version"
fi
if [ ! -z "$REINSTALL_PACKAGES_FROM" ] \
&& [ "_$REINSTALL_PACKAGES_FROM" != "_N/A" ]; then
nvm reinstall-packages "$REINSTALL_PACKAGES_FROM"