Compare commits

..

16 Commits

Author SHA1 Message Date
ryenus
4b4f22d9d5
Merge d655614c69569444e2f280b9f25e20f29ae24223 into ccf6d160172ab57f9777e88af5fa51240108285a 2024-11-06 11:22:57 +00:00
ryenus
d655614c69 show a warning about skipped versions if any
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.
2024-11-06 17:48:34 +08:00
ryenus
cd30a37384 set NVM_NO_COLORS to --no-colors to disable color 2024-11-06 17:48:34 +08:00
ryenus
c13e155709 rename min_ver to min for consistency 2024-11-06 17:48:34 +08:00
ryenus
90de98bbfc [test] avoid leaking temp variable 2024-11-06 17:48:34 +08:00
ryenus
4613313498 ls-remote: introduce temp var for env inheritance
This is to inherit $NVM_MIN from env when defined, meanwhile avoiding
inline local variable initialization for ksh compatibility.

Co-authored-by: Jordan Harband <ljharb@gmail.com>
2024-11-06 17:48:34 +08:00
ryenus
e493440b3c avoid inline initialization for ksh compatibility
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2024-11-06 17:48:34 +08:00
ryenus
b9304f18dc ls-remote: add CLI option --min=<version>
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.
2024-11-06 17:48:34 +08:00
ryenus
e215a57abd always show updates for installed versions
even if they're older than $NVM_MIN
2024-11-06 17:48:34 +08:00
ryenus
e7df2f2110 remove function ref duplication 2024-11-06 17:48:23 +08:00
ryenus
5fc1ebc91e prefixed versions like v18 also work 2024-11-06 17:48:23 +08:00
ryenus
2a893e5b5d rename NVM_MIN_VER to NVM_MIN
since nvm is all about versions, so no need for the explicit suffix.
2024-11-06 17:48:23 +08:00
ryenus
8ec7a3b5fc trim leading space in mock output due to eclint errors 2024-11-06 17:48:23 +08:00
ryenus
02bb9338e1 add test for NVM_MIN_VER support
show only versions newer than NVM_MIN_VER if set
2024-11-06 17:48:23 +08:00
ryenus
307ad6d118 always list installed versions 2024-11-06 17:48:22 +08:00
ryenus
6ebe56fb11 show only versions newer than NVM_MIN_VER if set 2024-11-06 17:48:22 +08:00

5
nvm.sh
View File

@ -1925,6 +1925,11 @@ BEGIN {
output[m++] = formatted;
}
skipped = rows - m + 1
if (skipped > 0) {
printf("[WARN] %d version(s) skipped.\n", skipped) > "/dev/stderr"
}
for (n = 1; n < m; n++) {
print output[n]
}