From a85fee1e06d0aaa00dcc10f58c9d71d39c1b62e7 Mon Sep 17 00:00:00 2001 From: ryenus Date: Mon, 29 Jan 2024 21:51:45 +0800 Subject: [PATCH] do not skip installed versions --- nvm.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 69d2f6dfa53..c83ebaafe1c 100644 --- a/nvm.sh +++ b/nvm.sh @@ -1760,9 +1760,7 @@ BEGIN { split(lines[n], fields, "[[:blank:]]+"); cols = alen(fields); version = fields[1]; - if (filter && comp(version, min_ver) < 0) continue; - filter = 0; is_installed = 0; for (i in installed) { if (version == installed[i]) { @@ -1771,6 +1769,14 @@ BEGIN { } } + if (filter && !is_installed) { + if (comp(version, min_ver) >= 0) { + filter = 0; + } else { + continue; + } + } + fmt_version = "%15s"; if (version == current) { fmt_version = fmt_current;