[Fix] `set -u`: ensure that potentially unbound variables aren’t called unchecked.
This commit is follow up for 853afbf
.
Fixes remaining bug in #1363
parent
0a95e77000
commit
caa7de37af
6
nvm.sh
6
nvm.sh
|
@ -2449,7 +2449,7 @@ nvm() {
|
||||||
|
|
||||||
if nvm_is_version_installed "$VERSION"; then
|
if nvm_is_version_installed "$VERSION"; then
|
||||||
nvm_err "$VERSION is already installed."
|
nvm_err "$VERSION is already installed."
|
||||||
if nvm use "$VERSION" && [ ! -z "$REINSTALL_PACKAGES_FROM" ] && [ "_$REINSTALL_PACKAGES_FROM" != "_N/A" ]; then
|
if nvm use "$VERSION" && [ -n "${REINSTALL_PACKAGES_FROM-}" ] && [ "_$REINSTALL_PACKAGES_FROM" != "_N/A" ]; then
|
||||||
nvm reinstall-packages "$REINSTALL_PACKAGES_FROM"
|
nvm reinstall-packages "$REINSTALL_PACKAGES_FROM"
|
||||||
fi
|
fi
|
||||||
if [ -n "${LTS-}" ]; then
|
if [ -n "${LTS-}" ]; then
|
||||||
|
@ -2517,7 +2517,7 @@ nvm() {
|
||||||
else
|
else
|
||||||
nvm_ensure_default_set "$provided_version"
|
nvm_ensure_default_set "$provided_version"
|
||||||
fi
|
fi
|
||||||
if [ ! -z "$REINSTALL_PACKAGES_FROM" ] \
|
if [ -n "${REINSTALL_PACKAGES_FROM-}" ] \
|
||||||
&& [ "_$REINSTALL_PACKAGES_FROM" != "_N/A" ]; then
|
&& [ "_$REINSTALL_PACKAGES_FROM" != "_N/A" ]; then
|
||||||
nvm reinstall-packages "$REINSTALL_PACKAGES_FROM"
|
nvm reinstall-packages "$REINSTALL_PACKAGES_FROM"
|
||||||
EXIT_CODE=$?
|
EXIT_CODE=$?
|
||||||
|
@ -2722,7 +2722,7 @@ nvm() {
|
||||||
# Prepend current version
|
# Prepend current version
|
||||||
PATH="$(nvm_prepend_path "$PATH" "$NVM_VERSION_DIR/bin")"
|
PATH="$(nvm_prepend_path "$PATH" "$NVM_VERSION_DIR/bin")"
|
||||||
if nvm_has manpath; then
|
if nvm_has manpath; then
|
||||||
if [ -z "$MANPATH" ]; then
|
if [ -z "${MANPATH-}" ]; then
|
||||||
local MANPATH
|
local MANPATH
|
||||||
MANPATH=$(manpath)
|
MANPATH=$(manpath)
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue