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

Add support for release stream codenames to install, bin, and use #515

Closed
wants to merge 1 commit into from

Conversation

shadowspawn
Copy link
Collaborator

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.

@shadowspawn
Copy link
Collaborator Author

For interest, I later added routines to more explicitly recognise the various patterns for versions, instead of assuming that any text string might be a codename. e.g. from nvh

function is_lts_codename() {
  # https://github.com/nodejs/Release/blob/master/CODENAMES.md
  # e.g. argon, Boron
  [[ "$1" =~ ^([Aa]rgon|[Bb]oron|[Cc]arbon|[Dd]ubnium|[Ee]rbium|[Ff]ermium|[Gg]allium|[Hh]ydrogen|[Ii]ron)$ ]]
}

Could add that into this Pull Request if that direction for the code is wanted.

@shadowspawn
Copy link
Collaborator Author

Had a couple of thumbs-up in six months but no maintainer interest. Closing for now.

This feature is available in my fork: https://github.com/JohnRGee/nvh

@shadowspawn shadowspawn deleted the feature/codenames-2 branch February 11, 2019 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant