Skip to content
Myr

[Fix] `set -u`: ensure `NVM_USE_OUTPUT` is always set.

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

Fixes #1671.

authored by Jordan Harband · committed by Jordan Harband · parent 7bfd1e0 · Browse files · 2 files+3 added−2 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+3 added−2 removed

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

2 files+3 added−2 removed

modified:test/fast/Running "nvm use system" should work as expected+1 added-1 removed
1#!/bin/sh23set -ex3set -eux45cleanup() {6 unset -f nvm_has_system_node nvm_print_npm_version7}
37 unmodified lines
modified:nvm.sh+2 added-1 removed
506 unmodified lines
507508 local NVM_LS_REMOTE_IOJS_EXIT_CODE509 NVM_LS_REMOTE_IOJS_EXIT_CODE=0510 local NVM_LS_REMOTE_IOJS_OUTPUT511 NVM_LS_REMOTE_IOJS_OUTPUT=511 NVM_LS_REMOTE_IOJS_OUTPUT=''512 if [ -z "${NVM_LTS-}" ] && ( \513 [ -z "${NVM_FLAVOR-}" ] || [ "${NVM_FLAVOR-}" = "${NVM_IOJS_PREFIX}" ] \514 ); then515 NVM_LS_REMOTE_IOJS_OUTPUT=$(nvm_ls_remote_iojs "${PATTERN-}") &&:
2385 unmodified lines
2901 if [ "${NVM_SYMLINK_CURRENT-}" = true ]; then2902 command rm -f "$NVM_DIR/current" && ln -s "$NVM_VERSION_DIR" "$NVM_DIR/current"2903 fi2904 local NVM_USE_OUTPUT2905 NVM_USE_OUTPUT=''2906 if [ $NVM_USE_SILENT -ne 1 ]; then2907 if nvm_is_iojs_version "$VERSION"; then2908 NVM_USE_OUTPUT="Now using io.js $(nvm_strip_iojs_prefix "$VERSION")$(nvm_print_npm_version)"2909 else
620 unmodified lines