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

Only nvm install if we can't nvm use #1378

Merged
merged 1 commit into from
Jan 5, 2017
Merged

Conversation

lukechilds
Copy link
Contributor

Resolves #1377

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.

Isn't this a duplicate of #1357?

@@ -322,7 +322,9 @@ load-nvmrc() {
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")

if [ "$nvmrc_node_version" != "N/A" ] && [ "$nvmrc_node_version" != "$node_version" ]; then
if [ "$nvmrc_node_version" != "N/A" ]; then
[ "$nvmrc_node_version" != "$node_version" ] && nvm use
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 use an if here instead of &&, or else it'll run afoul of set -e

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@lukechilds lukechilds force-pushed the auto-use branch 2 times, most recently from 337984d to 5f5bdd7 Compare January 5, 2017 06:38
@lukechilds
Copy link
Contributor Author

Yeah, sorry, it is a duplicate as #1357. I missed that.

Although this doesn't have the unnecessary extra if condition.

@lukechilds
Copy link
Contributor Author

Just FYI, auto use implementation is completed in zsh-nvm.

@ljharb ljharb merged commit f1a5f2a into nvm-sh:master Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants