Skip to content

Conversation

@blr246
Copy link
Contributor

@blr246 blr246 commented Jan 27, 2021

As per #2420, when using nvm install with an already installed
version, Bash (and potentially other shells) may emit an unbound
variable error when set -u is set. The presence of the error depends
on specific shell versions, but appears to happen in MacOS 11.1 (Big
Sur) using a recent Bash version installed via Homebrew (as of this
writing).

The fix accesses ALIAS correctly for the case where it is not set by
an alias option to nvm install.

Fixes nvm-sh#2420. When using `nvm install` with an already installed
version, Bash (and potentially other shells) may emit an unbound
variable error when `set -u` is set. The presence of the error depends
on specific shell versions, but appears to happen in MacOS 11.1 (Big
Sur) using a recent Bash version installed via Homebrew (as of this
writing).

The fix accesses `ALIAS` correctly for the case where it is not set by
an `alias` option to `nvm install`.
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 force-pushed the fix-alias-unbound-2420 branch from d1b4bad to 3243f7a Compare January 27, 2021 18:35
@ljharb ljharb merged commit 3243f7a into nvm-sh:master Jan 27, 2021
@blr246 blr246 deleted the fix-alias-unbound-2420 branch January 27, 2021 18:44
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