[New] ls-remote, install, version-remote: add --min=
add CLI option --min=<version>, fallback to env var "NVM_MIN" if set. The latter two pick the newest match, which is below the minimum only when every match is, so they check the resolved version. `ls-remote` prints its notice on stderr, so the list stays parseable. Other minor changes: - fix: disable color in nvm_print_versions tests - trim leading space in mock output due to eslint errors - ensure prefixed versions like v18 also work - remove function ref duplication - avoid inline initialization for ksh compatibility - apply `--min=` before checking for an empty list; require a version Co-authored-by: ryenus <ryenus@gmail.com> Co-authored-by: Jordan Harband <ljharb@gmail.com>
This commit is contained in:
1 parent
68986f7778
commit
ceef142f8a
3 files changed
+338
-4
No files matched your search
@@ -404,6 +404,13 @@ You can list available versions using `ls-remote`:
|
||||
nvm ls-remote
|
||||
```
|
||||
|
||||
To hide versions below a given version, use `--min=`, or set `NVM_MIN` to the same kind of version, for example in your shell profile; `--min=` overrides it. `nvm install` and `nvm version-remote` accept it too, and fail rather than select a version below it:
|
||||
|
||||
```sh
|
||||
nvm ls-remote --min=20
|
||||
nvm ls-remote --only=lts --min=v18.2
|
||||
```
|
||||
|
||||
When no version or `--lts` filter is given, the list also marks the version the `node` alias would install, and every version that one of your own aliases would resolve to. Each kind of annotation always starts in the same column, so the output can be sliced with `cut -c` or similar tools:
|
||||
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user