Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[Fix] nvm_ls_remote_index_tab: handle long version lists
  • Loading branch information
kstolp authored and ljharb committed Sep 4, 2021
commit 291c7c4c47772f3a8f531de4b83049fcc5bb91f3
7 changes: 4 additions & 3 deletions nvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1396,8 +1396,7 @@ nvm_ls_remote_index_tab() {
local LTS_ALIAS
local LTS_VERSION
command mkdir -p "$(nvm_alias_path)/lts"
nvm_echo "${VERSION_LIST}" \
| command awk '{
{ command awk '{
if ($10 ~ /^\-?$/) { next }
if ($10 && !a[tolower($10)]++) {
if (alias) { print alias, version }
Expand All @@ -1416,7 +1415,9 @@ nvm_ls_remote_index_tab() {
LTS_ALIAS="${LTS_ALIAS_LINE%% *}"
LTS_VERSION="${LTS_ALIAS_LINE#* }"
nvm_make_alias "${LTS_ALIAS}" "${LTS_VERSION}" >/dev/null 2>&1
done
done; } << EOF
$VERSION_LIST
EOF

VERSIONS="$({ command awk -v lts="${LTS-}" '{
if (!$1) { next }
Expand Down