-
-
Couldn't load subscription status.
- Fork 9.5k
[Fix] nvm exec: Do a version check on nvm-exec
#3308
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
base: master
Are you sure you want to change the base?
Changes from all commits
e2ff1e7
05feeaa
5a28180
650b069
ce777fa
59b40b8
8066dc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -x | ||
| \. ../../nvm.sh | ||
|
|
||
| NVM_TEST_VERSION=v0.42 | ||
|
|
||
| # Write it to nvmrc | ||
| echo "$NVM_TEST_VERSION" > .nvmrc | ||
|
|
||
| OUTPUT="$(../../nvm-exec 2>&1)"; | ||
| EXPECTED="N/A: version \"${NVM_TEST_VERSION}\" is not yet installed. | ||
| You need to run \`nvm install ${NVM_TEST_VERSION}\` to install and use it. | ||
| No NODE_VERSION provided; no .nvmrc file found"; | ||
|
|
||
| # Skip install, we want to test the error message | ||
| diff <(echo "${EXPECTED}") <(echo "${OUTPUT}") | ||
| rm .nvmrc | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aha, good catch. note tho that this doesn't actually restore what might already be present - we should back up and restore the existing i'll take a crack at this part tho |
||
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 line can't work tho, due to https://www.shellcheck.net/wiki/SC3001 - i'll change this to a normal
=comparison unless you have a better ideaThere 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.
Yeah, sound reasonable.
Was hoping that the
#!/bin/bashon top would allow for that to pass, but I think=should work too.