Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Add default empty value for NVM_NO_ALIAS variable #2047

Merged
merged 1 commit into from May 15, 2019

Conversation

Projects
None yet
2 participants
@sehrope
Copy link
Contributor

commented May 14, 2019

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.

Reproduce error via:

$ set -u ; nvm ls 12
bash: NVM_NO_ALIAS: unbound variable
[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.
@ljharb
Copy link
Collaborator

left a comment

Thanks! Can we add a test that would catch this?

@ljharb

This comment has been minimized.

Copy link
Collaborator

commented May 14, 2019

(Note that when I run set -u; nvm ls 0.13, for example, I don't get this error)

@sehrope sehrope force-pushed the sehrope:fix-nvm-no-alias-unset branch 2 times, most recently from a10fb10 to bb90d63 May 14, 2019

@sehrope

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

Added a test for enabling nounset and checking for any stderr in a couple situations of nvm ls .... It fails when applied on it's own: https://travis-ci.org/sehrope/nvm/jobs/532527831#L390

With the fix applied, the test passes. 🎉

@ljharb

ljharb approved these changes May 15, 2019

Copy link
Collaborator

left a comment

Thanks!

Still confused why this can't repro on my Mac; maybe it's got an outdated or broken bash.

@ljharb ljharb force-pushed the sehrope:fix-nvm-no-alias-unset branch from bb90d63 to 0b5bb5c May 15, 2019

@ljharb ljharb merged commit 0b5bb5c into nvm-sh:master May 15, 2019

1 of 2 checks passed

continuous-integration/travis-ci/push The Travis CI build is in progress
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.