Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixes #1394.

authored by Jordan Harband · committed by Jordan Harband · parent 1b23052 · Browse files · 2 files+5 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+5 added−3 removed

  • tests:+0 added−2 removed
  • other:+5 added−1 removed

2 files+5 added−3 removed

modified:test/installation_node/install LTS-2 removed
22 unmodified lines
23EXPECTED_OUTPUT="Version '3' (with LTS filter 'argon') not found - try \`nvm ls-remote --lts=argon\` to browse available versions."24[ "${EXIT_CODE}" = 3 ] || die "\`nvm install --lts=argon 3\` did not exit with 3, got >${EXIT_CODE}<"25[ "${OUTPUT}" = "${EXPECTED_OUTPUT}" ] || die "\`nvm install --lts=argon 3\` output >${OUTPUT}<, expected >${EXPECTED_OUTPUT}<"2627set +e # TODO: fix27nvm install --lts 4.2.2 || die 'nvm install --lts 4.2.2 failed'29set -e2829[ "$(nvm current)" = "v4.2.2" ] || die "v4.2.2 not current, got $(nvm_current)"
modified:nvm.sh+5 added-1 removed
2458 unmodified lines
24592460 fi24612462 if [ "$NVM_INSTALL_SUCCESS" = true ] && nvm use "$VERSION"; then2463 if [ -n "${LTS-}" ]; then2464 nvm_ensure_default_set "lts/${LTS}"2465 else2463 nvm_ensure_default_set "$provided_version"2466 nvm_ensure_default_set "$provided_version"2467 fi2468 if [ ! -z "$REINSTALL_PACKAGES_FROM" ] \2469 && [ "_$REINSTALL_PACKAGES_FROM" != "_N/A" ]; then2470 nvm reinstall-packages "$REINSTALL_PACKAGES_FROM"2471 fi
818 unmodified lines