[Fix] set -u: Add default empty value for $NVM_NO_ALIAS

Adds a default value for NVM_NO_ALIAS so that nvm ls does not error out when run
in a bash nounset/-u (no unset vars) environment.
This commit is contained in:
Sehrope Sarkuni
2019-05-14 08:31:24 -04:00
committed by Jordan Harband
parent 45c1b84794
commit 0b5bb5ccd8
2 changed files with 24 additions and 1 deletions

2
nvm.sh
View File

@@ -3161,7 +3161,7 @@ nvm() {
esac
shift
done
if [ -n "${PATTERN-}" ] && [ -n "${NVM_NO_ALIAS}" ]; then
if [ -n "${PATTERN-}" ] && [ -n "${NVM_NO_ALIAS-}" ]; then
nvm_err '`--no-alias` is not supported when a pattern is provided.'
return 55
fi