ryenus
206a14297c
rename min_ver to min for consistency
2025-04-14 20:43:17 +08:00
ryenus
f99c9f30cd
[test] avoid leaking temp variable
2025-04-14 20:43:17 +08:00
ryenus and Jordan Harband
c02964100e
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 >
2025-04-14 20:43:17 +08:00
ryenus and Jordan Harband
e71918ec8c
avoid inline initialization for ksh compatibility
...
Co-authored-by: Jordan Harband <ljharb@gmail.com >
2025-04-14 20:43:17 +08:00
ryenus
594f8c0a80
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.
2025-04-14 20:43:17 +08:00
ryenus
54a5777ff8
always show updates for installed versions
...
even if they're older than $NVM_MIN
2025-04-14 20:43:08 +08:00
ryenus
858eda58c4
remove function ref duplication
2025-04-14 20:43:08 +08:00
ryenus
f2b7583b6b
prefixed versions like v18 also work
2025-04-14 20:43:08 +08:00
ryenus
b16b4ee6ad
rename NVM_MIN_VER to NVM_MIN
...
since nvm is all about versions, so no need for the explicit suffix.
2025-04-14 20:43:08 +08:00
ryenus
9f4dd6477a
trim leading space in mock output due to eclint errors
2025-04-14 20:43:08 +08:00
ryenus
c390144c1e
add test for NVM_MIN_VER support
...
show only versions newer than NVM_MIN_VER if set
2025-04-14 20:43:08 +08:00
ryenus
37811e0d7d
always list installed versions
2025-04-14 20:43:08 +08:00
ryenus
48fe276e36
show only versions newer than NVM_MIN_VER if set
2025-04-14 20:43:08 +08:00
ryenus
095a4ca655
[Fix] debug: awk: not an option: --version
...
On Debian, the default awk/mawk doesn't support the '--version' option;
instead there's mawk-specific '-W version'.
2022-10-21 16:48:00 +08:00
ryenus
9721791563
[Fix] grep: warning: stray \ before /
...
No need to escape the `/` char in a grep pattern.
This is to fix the below error when using newer grep with `nvm_command_info`
> $ nvm_command_info curl
> grep: warning: stray \ before /
> /usr/bin/curl
This happens with at least GNU grep 3.8 version.
2022-10-20 10:49:43 +08:00
ryenus
89d6cdd6cf
[Fix] improve backward compatibility for non-gnu awk
...
Adding function alen(arr) since length(arr) is GNU extension.
Fixes #2916
2022-10-18 11:25:12 +08:00
ryenus
5e9791c4f8
[perf] nvm_print_versions: re-implement using awk
...
reducing `nvm ls-remote` from almost 20s to below 2s.
Signed-off-by: ryenus <ryenus@gmail.com >
2022-06-05 13:27:03 +08:00