Skip to content

Commit

Permalink
[Fix] nvm_ls_remote_index_tab: only compare the pattern to the vers…
Browse files Browse the repository at this point in the history
…ion, not the LTS name

Fixes 3474
  • Loading branch information
ljharb committed Nov 21, 2024
1 parent f7363ac commit 4f91e99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1667,10 +1667,11 @@ EOF
LTS="${LTS#lts/}"
fi

VERSIONS="$({ command awk -v lts="${LTS-}" '{
VERSIONS="$({ command awk -v lts="${LTS-}" -v pattern="${PATTERN:-.*}" '{
if (!$1) { next }
if (lts && $10 ~ /^\-?$/) { next }
if (lts && lts != "*" && tolower($10) !~ tolower(lts)) { next }
if ($1 !~ pattern) { next }
if ($10 !~ /^\-?$/) {
if ($10 && $10 != prev) {
print $1, $10, "*"
Expand All @@ -1682,7 +1683,6 @@ EOF
}
prev=$10;
}' \
| nvm_grep -w "${PATTERN:-.*}" \
| $SORT_COMMAND; } << EOF
$VERSION_LIST
EOF
Expand Down

0 comments on commit 4f91e99

Please sign in to comment.