Revert "Revert "[Fix] `set -u`: ensure that potentially unbound variables aren’t called unchecked.""

This reverts commit a8c465018e.

Fixes #1363.
Jordan Harband 2016-12-26 21:57:55 -08:00
parent a8c465018e
commit 853afbf595
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 4 additions and 3 deletions

7
nvm.sh
View File

@ -379,7 +379,7 @@ nvm_remote_versions() {
NVM_LS_REMOTE_PRE_MERGED_OUTPUT='' NVM_LS_REMOTE_PRE_MERGED_OUTPUT=''
local NVM_LS_REMOTE_POST_MERGED_OUTPUT local NVM_LS_REMOTE_POST_MERGED_OUTPUT
NVM_LS_REMOTE_POST_MERGED_OUTPUT='' NVM_LS_REMOTE_POST_MERGED_OUTPUT=''
if [ -z "${NVM_FLAVOR}" ] || [ "${NVM_FLAVOR}" = "${NVM_NODE_PREFIX}" ]; then if [ -z "${NVM_FLAVOR-}" ] || [ "${NVM_FLAVOR-}" = "${NVM_NODE_PREFIX}" ]; then
local NVM_LS_REMOTE_OUTPUT local NVM_LS_REMOTE_OUTPUT
NVM_LS_REMOTE_OUTPUT=$(NVM_LTS="${NVM_LTS-}" nvm_ls_remote "${PATTERN-}") &&: NVM_LS_REMOTE_OUTPUT=$(NVM_LTS="${NVM_LTS-}" nvm_ls_remote "${PATTERN-}") &&:
NVM_LS_REMOTE_EXIT_CODE=$? NVM_LS_REMOTE_EXIT_CODE=$?
@ -391,8 +391,8 @@ nvm_remote_versions() {
local NVM_LS_REMOTE_IOJS_EXIT_CODE local NVM_LS_REMOTE_IOJS_EXIT_CODE
NVM_LS_REMOTE_IOJS_EXIT_CODE=0 NVM_LS_REMOTE_IOJS_EXIT_CODE=0
local NVM_LS_REMOTE_IOJS_OUTPUT local NVM_LS_REMOTE_IOJS_OUTPUT
if [ -z "${NVM_LTS}" ] && ( \ if [ -z "${NVM_LTS-}" ] && ( \
[ -z "${NVM_FLAVOR}" ] || [ "${NVM_FLAVOR}" = "${NVM_IOJS_PREFIX}" ] \ [ -z "${NVM_FLAVOR-}" ] || [ "${NVM_FLAVOR-}" = "${NVM_IOJS_PREFIX}" ] \
); then ); then
NVM_LS_REMOTE_IOJS_OUTPUT=$(nvm_ls_remote_iojs "${PATTERN-}") &&: NVM_LS_REMOTE_IOJS_OUTPUT=$(nvm_ls_remote_iojs "${PATTERN-}") &&:
NVM_LS_REMOTE_IOJS_EXIT_CODE=$? NVM_LS_REMOTE_IOJS_EXIT_CODE=$?
@ -2406,6 +2406,7 @@ nvm() {
fi fi
local NVM_INSTALL_SUCCESS local NVM_INSTALL_SUCCESS
NVM_INSTALL_SUCCESS=false
if [ -n "${NVM_INSTALL_THIRD_PARTY_HOOK-}" ]; then if [ -n "${NVM_INSTALL_THIRD_PARTY_HOOK-}" ]; then
nvm_err '** $NVM_INSTALL_THIRD_PARTY_HOOK env var set; dispatching to third-party installation method **' nvm_err '** $NVM_INSTALL_THIRD_PARTY_HOOK env var set; dispatching to third-party installation method **'
local NVM_METHOD_PREFERENCE local NVM_METHOD_PREFERENCE