Skip to content

Commit

Permalink
do not skip installed versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ryenus committed Jan 29, 2024
1 parent 28444c5 commit 241cc22
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1755,14 +1755,12 @@ BEGIN {
split(remote_versions, lines, "|");
split(installed_versions, installed, "|");
rows = alen(lines);
filter = (min_ver != "v0");
filter_on = (min_ver != "v0");
for (m = n = 1; n <= rows; n++) {
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]) {
Expand All @@ -1771,6 +1769,14 @@ BEGIN {
}
}
if (filter_on && !is_installed) {
if (comp(version, min_ver) >= 0) {
filter_on = 0;
} else {
continue;
}
}
fmt_version = "%15s";
if (version == current) {
fmt_version = fmt_current;
Expand Down

0 comments on commit 241cc22

Please sign in to comment.