From 291c7c4c47772f3a8f531de4b83049fcc5bb91f3 Mon Sep 17 00:00:00 2001 From: Kevin Stolp Date: Fri, 3 Sep 2021 23:40:13 -0700 Subject: [PATCH] [Fix] `nvm_ls_remote_index_tab`: handle long version lists --- nvm.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nvm.sh b/nvm.sh index 15d1ba8..1ba89c6 100644 --- a/nvm.sh +++ b/nvm.sh @@ -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 } @@ -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 }