-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
show only versions newer than NVM_MIN if set #3277
base: master
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
a81e16a
to
b10554a
Compare
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.
I like that it's done in awk :-) it'd be great to benchmark the difference to make sure this isn't slowing anything down meaningfully.
this will need tests, and also it'd be good to add a --min
option to all the things that talk to the mirror (nvm ls-remote
, nvm install
, nvm version-remote
) and then maybe nvm ls
for good measure (altho that can be a follow-on if you like)
Performance-wise there's not really much change or overhead, you can trust that awk is fast :-) Sometimes it might even run faster, esp. when many older versions are skipped. Meanwhile the other sibling functions and even the tests are something I'm not really familiar with, may you can chime in here? @ljharb |
Sure - for the tests, there's existing tests for For adding an option, if you grep for |
c6cfc3a
to
c20db2a
Compare
abde015
to
132b9fb
Compare
@ljharb just added a test, however Travis CI seems stuck, any insight? |
This comment was marked as resolved.
This comment was marked as resolved.
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.
It occurs to me that
46690fd
to
daad693
Compare
This comment was marked as resolved.
This comment was marked as resolved.
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 looks great, I'll play with it locally a bit this week.
When I run When I run |
ohhh wait, lol i think this is the actual feature i asked for - i have tons of node versions installed, going back a very long way: $ NVM_MIN=4 nvm ls-remote | wc -l
711
$ nvm ls-remote --min=4 | wc -l
711
$ nvm ls-remote | wc -l
790 in other words, it's filtering some things out, but with the additional logic i requested, it's still showing me a lot of things i didn't expect. 🤔 |
Ahh, so it's because you have just too many versions installed? Or would you change mind? Hopefully not :P BTW, typically I just run something like |
@ljharb FYI, just rebased with some minor fix in tests. |
@ljharb may I ask how it is going? anything to note? |
No progress yet; I've been traveling. I'm prioritizing a bug fix on nvm before this PR, but it'll be next in line after that. |
ok, so i just tried it out again. if i do I'm starting to wonder if perhaps my original concern - about versions being hidden - is better addressed by prepending a message like "Minimum version X set: N versions hidden", and going back to the simpler logic? (i'm super sorry if this means you're doing work to undo the work i already asked you to do :-/ unfortunately sometimes it takes time and first-hand experience to really get a sense of the DX/UX of a thing) |
@ljharb, although in some cases it's somehow possible to have a broad range of node versions installed, but I'm sure not everyone would need to do that. I believe most people only need (a) several (if not a few), and (b) most recent, (c) typically LTS versions, installed for the project(s) they work on. Like what's shown in a previous comment: And this is sort of the next step for the previous pr #2827, that one has improved the performance of
Meanwhile no worries, your initial proposal actually inspired me to think more about why people would need |
BTW, the error with
Same error also appeared in master builds |
show only versions newer than NVM_MIN_VER if set
since nvm is all about versions, so no need for the explicit suffix.
even if they're older than $NVM_MIN
When omitted, fallback to the environment variable "NVM_MIN" if set. And the CLI option --min=<version> takes precedence over the environment variable "NVM_MIN" if both are present.
Co-authored-by: Jordan Harband <[email protected]>
This is to inherit $NVM_MIN from env when defined, meanwhile avoiding inline local variable initialization for ksh compatibility. Co-authored-by: Jordan Harband <[email protected]>
due the use of --min or NVM_MIN, which would show only the versions higher than the specified min version, and/or the available minor/patch updates for the installed versions.
This is to fix #3250.