[Fix] `nvm_ls_remote_index_tab`: handle long version lists

Kevin Stolp 2021-09-03 23:40:13 -07:00 committed by Jordan Harband
parent c169d622ff
commit 291c7c4c47
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 4 additions and 3 deletions

7
nvm.sh
View File

@ -1396,8 +1396,7 @@ nvm_ls_remote_index_tab() {
local LTS_ALIAS local LTS_ALIAS
local LTS_VERSION local LTS_VERSION
command mkdir -p "$(nvm_alias_path)/lts" command mkdir -p "$(nvm_alias_path)/lts"
nvm_echo "${VERSION_LIST}" \ { command awk '{
| command awk '{
if ($10 ~ /^\-?$/) { next } if ($10 ~ /^\-?$/) { next }
if ($10 && !a[tolower($10)]++) { if ($10 && !a[tolower($10)]++) {
if (alias) { print alias, version } if (alias) { print alias, version }
@ -1416,7 +1415,9 @@ nvm_ls_remote_index_tab() {
LTS_ALIAS="${LTS_ALIAS_LINE%% *}" LTS_ALIAS="${LTS_ALIAS_LINE%% *}"
LTS_VERSION="${LTS_ALIAS_LINE#* }" LTS_VERSION="${LTS_ALIAS_LINE#* }"
nvm_make_alias "${LTS_ALIAS}" "${LTS_VERSION}" >/dev/null 2>&1 nvm_make_alias "${LTS_ALIAS}" "${LTS_VERSION}" >/dev/null 2>&1
done done; } << EOF
$VERSION_LIST
EOF
VERSIONS="$({ command awk -v lts="${LTS-}" '{ VERSIONS="$({ command awk -v lts="${LTS-}" '{
if (!$1) { next } if (!$1) { next }