Auto install not exist version in zsh .nvmrc script, close #1272#1306
Auto install not exist version in zsh .nvmrc script, close #1272#1306ljharb merged 1 commit intonvm-sh:masterfrom
Conversation
|
@ljharb would you like to review this one? Thanks. |
README.markdown
Outdated
|
|
||
| if [ "$nvmrc_node_version" != "N/A" ] && [ "$nvmrc_node_version" != "$node_version" ]; then | ||
| nvm use | ||
| nvm use |
There was a problem hiding this comment.
this will run nvm install when [ "$nvmrc_node_version" = "$node_version" ], which isn't desired.
My comment meant that this should simply call nvm install, and not call nvm use at all.
There was a problem hiding this comment.
Just simply replace nvm use with nvm install here?
There was a problem hiding this comment.
I thought directly use nvm install it may show something like v4.6.2 is already installed. if the version is already installed, but if you don't mind I'll be fine.
There was a problem hiding this comment.
hm, yeah that's true. maybe it's best to run the appropriate command. this still needs to be tweaked tho.
There was a problem hiding this comment.
@ljharb what about this?
if nvm_is_version_installed "$nvmrc_node_version";
nvm use
else
nvm install
fiThere was a problem hiding this comment.
[ "$nvmrc_node_version" = "N/A" ] already tells you it's not installed
There was a problem hiding this comment.
ohhhhhh ... I'm stupid lol ... hope this version is correct now:
if [ "$nvmrc_node_version" = "N/A" ]; then
nvm install
elif [ "$nvmrc_node_version" != "$node_version" ]; then
nvm use
fi416b691 to
50fb098
Compare
|
@ljharb are we good to go here? Thanks. |
|
|
||
| if [ "$nvmrc_node_version" != "N/A" ] && [ "$nvmrc_node_version" != "$node_version" ]; then | ||
| nvm use | ||
| nvm install |
There was a problem hiding this comment.
This will result in extra terminal output when it's already installed - although perhaps that's not a concern.
There was a problem hiding this comment.
I think it's acceptable 👍
No description provided.