Compare commits

..

15 Commits

Author SHA1 Message Date
ryenus
69261939ba
Merge 3e15282773717ade9e64eee6408bf882e9b803fa into 5dc31ac51b08f910a2de1596b37a6a3dddd5e7b7 2024-10-18 15:14:15 +00:00
ryenus
3e15282773 set NVM_NO_COLORS to --no-colors to disable color 2024-10-18 23:13:10 +08:00
ryenus
060adbd05e rename min_ver to min for consistency 2024-10-18 23:13:10 +08:00
ryenus
08f28abbdd [test] avoid leaking temp variable 2024-10-18 23:13:10 +08:00
ryenus
1f3af439c3 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-10-18 23:13:10 +08:00
ryenus
686d33b066 avoid inline initialization for ksh compatibility
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2024-10-18 23:13:10 +08:00
ryenus
e77828a448 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-10-18 23:13:10 +08:00
ryenus
2749487689 always show updates for installed versions
even if they're older than $NVM_MIN
2024-10-18 23:13:05 +08:00
ryenus
cb267d6302 remove function ref duplication 2024-10-08 20:20:10 +08:00
ryenus
646e3bb869 prefixed versions like v18 also work 2024-10-08 20:20:10 +08:00
ryenus
a2996f3b0e rename NVM_MIN_VER to NVM_MIN
since nvm is all about versions, so no need for the explicit suffix.
2024-10-08 20:20:10 +08:00
ryenus
4c67ced319 trim leading space in mock output due to eclint errors 2024-10-08 20:20:10 +08:00
ryenus
f4c2477a0b add test for NVM_MIN_VER support
show only versions newer than NVM_MIN_VER if set
2024-10-08 20:20:10 +08:00
ryenus
5b57613aac always list installed versions 2024-10-08 20:20:10 +08:00
ryenus
be4f15d833 show only versions newer than NVM_MIN_VER if set 2024-10-08 20:20:10 +08:00

4
nvm.sh
View File

@ -1894,7 +1894,7 @@ BEGIN {
}
if (filter_on != 0) {
if (is_installed != 0) {
if (is_installed) {
current_major = v2m(version);
} else if (vcmp(version, min) >= 0) {
filter_on = 0;
@ -1908,7 +1908,7 @@ BEGIN {
fmt_version = fmt_current;
} else if (version == "system") {
fmt_version = fmt_system;
} else if (is_installed != 0) {
} else if (is_installed) {
fmt_version = fmt_installed;
}