Add support for release stream codenames to install, bin, and use #515
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.
Pull Request Template:
Describe what you did
Added support for codenames (currently valid are argon, boron, carbon) for install, bin, and use commands. Added release stream options to README.
How you did it
Looked up mirror site for latest version in latest- folder.
How to verify it doesn't effect the functionality of n
Tested on MacOS.
$ n 8
$ node --version
v8.11.3
$ n v8.0.0
$ node --version
v8.0.0
$ n 9.0.0
$ node --version
v9.0.0
$ n argon
$ node --version
v4.9.1
$ n boron
$ node --version
v6.14.3
$ n carbon
$ node --version
v8.11.3
$ n dubnium
dubnium Error: invalid codename dubnium
$ n latest
$ node --version
v10.5.0
$ n lts
$ node --version
v8.11.3
$ n bin v8.0.0
/usr/local/n/versions/node/8.0.0/bin/node
$ n bin 9.0.0
/usr/local/n/versions/node/9.0.0/bin/node
$ n bin argon
/usr/local/n/versions/node/4.9.1/bin/node
$ n bin boron
/usr/local/n/versions/node/6.14.3/bin/node
$ n bin carbon
/usr/local/n/versions/node/8.11.3/bin/node
$ n bin latest
/usr/local/n/versions/node/10.5.0/bin/node
$ n bin lts
/usr/local/n/versions/node/8.11.3/bin/node
$ n use v8.0.0 --version
v8.0.0
$ n use 9.0.0 --version
v9.0.0
$ n use argon --version
v4.9.1
$ n use boron --version
v6.14.3
$ n use carbon --version
v8.11.3
$ n use latest --version
v10.5.0
$ n use lts --version
v8.11.3
If this solves an issue, please put issue in PR notes.
Solves issue #423
Also, remove buggy stripping of leading v from codenames.
Also, made error message for bin and use consistent with looking up version from codename.
If this solves an issue, please include the output of issue that had problems and then the fixed output from the same command.
Before
$ n boron
Error: invalid version boron
$ n vboron
Error: invalid version boron
$ n bin lts
Error: lts is not installed
After
$ n boron
$ n vboron
Error: invalid codename vboron
$ n bin lts
Error: 8.11.3 is not installed
Squash any unnecessary commits to keep history clean as possible
Place description for the changelog in PR so we can tally all changes for any future release
Added support for codenames (currently valid are argon, boron, carbon) to install, bin, and use commands.