-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 :-)
There was a problem hiding this comment.
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-}" ] \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I noticed #1363 is not fixed completely.
This PR fixes additional causes.