-
-
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
[Fix] nvm exec
: Do a version check on nvm-exec
#3308
Open
userwiths
wants to merge
7
commits into
nvm-sh:master
Choose a base branch
from
userwiths:fork-dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e2ff1e7
fix: Do a version check on `nvm-exec`
userwiths 05feeaa
[Fix] `nvm exec`: Do a version check on `nvm-exec`
userwiths 5a28180
tests: Add test to check if the message contains the relevant informa…
userwiths 650b069
Seems changes done in docker do not persist, had to reapply them
userwiths ce777fa
Merge branch 'fork-dev' of https://github.com/userwiths/nvm into fork…
userwiths 59b40b8
Rookie mistake from my side, forgot to clean-up the nvmrc, which caus…
userwiths 8066dc8
remove test from slow folder
userwiths File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
test/fast/Running 'nvm-exec' should display required node version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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/bash
on top would allow for that to pass, but I think=
should work too.