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

Additional fix for potentially unbound variables in bash strict mode #1516

Merged
merged 1 commit into from
Apr 28, 2017
Merged

Additional fix for potentially unbound variables in bash strict mode #1516

merged 1 commit into from
Apr 28, 2017

Conversation

phanect
Copy link
Contributor

@phanect phanect commented Apr 27, 2017

I noticed #1363 is not fixed completely.
This PR fixes additional causes.

…ed unchecked.

This commit is follow up for 853afbf.
Fixes remaining bug in #1363
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

nvm.sh Outdated
@@ -2449,7 +2449,7 @@ nvm() {

if nvm_is_version_installed "$VERSION"; then
nvm_err "$VERSION is already installed."
if nvm use "$VERSION" && [ ! -z "$REINSTALL_PACKAGES_FROM" ] && [ "_$REINSTALL_PACKAGES_FROM" != "_N/A" ]; then
if nvm use "$VERSION" && [ ! -z "${REINSTALL_PACKAGES_FROM-}" ] && [ "_$REINSTALL_PACKAGES_FROM" != "_N/A" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's change this ! -z to -n while we're at it :-)

Copy link
Contributor Author

@phanect phanect Apr 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes, that's better.
I've fixed it.

nvm.sh Outdated
@@ -2517,7 +2517,7 @@ nvm() {
else
nvm_ensure_default_set "$provided_version"
fi
if [ ! -z "$REINSTALL_PACKAGES_FROM" ] \
if [ ! -z "${REINSTALL_PACKAGES_FROM-}" ] \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one too

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ljharb ljharb merged commit caa7de3 into nvm-sh:master Apr 28, 2017
@phanect phanect deleted the strict branch April 30, 2017 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants