[Fix] `ls-remote`: fix issues in zsh when using a mirror with a ton of entries

Fixes #1813
adedomin 2018-05-23 19:47:11 -04:00 committed by Jordan Harband
parent f5f029c409
commit 7a5ff0d133
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 5 additions and 3 deletions

8
nvm.sh
View File

@ -1218,8 +1218,7 @@ nvm_ls_remote_index_tab() {
nvm_make_alias "$LTS_ALIAS" "$LTS_VERSION" >/dev/null 2>&1 nvm_make_alias "$LTS_ALIAS" "$LTS_VERSION" >/dev/null 2>&1
done done
VERSIONS="$(nvm_echo "${VERSION_LIST}" \ VERSIONS="$({ command awk -v pattern="${PATTERN-}" -v lts="${LTS-}" '{
| command awk -v pattern="${PATTERN-}" -v lts="${LTS-}" '{
if (!$1) { next } if (!$1) { next }
if (pattern && tolower($1) !~ tolower(pattern)) { next } if (pattern && tolower($1) !~ tolower(pattern)) { next }
if (lts == "*" && $10 ~ /^\-?$/) { next } if (lts == "*" && $10 ~ /^\-?$/) { next }
@ -1227,7 +1226,10 @@ nvm_ls_remote_index_tab() {
if ($10 !~ /^\-?$/) print $1, $10; else print $1 if ($10 !~ /^\-?$/) print $1, $10; else print $1
}' \ }' \
| nvm_grep -w "${PATTERN:-.*}" \ | nvm_grep -w "${PATTERN:-.*}" \
| $SORT_COMMAND)" | $SORT_COMMAND; } << EOF
$VERSION_LIST
EOF
)"
if [ "$ZSH_HAS_SHWORDSPLIT_UNSET" -eq 1 ] && nvm_has "unsetopt"; then if [ "$ZSH_HAS_SHWORDSPLIT_UNSET" -eq 1 ] && nvm_has "unsetopt"; then
unsetopt shwordsplit unsetopt shwordsplit
fi fi