Sort `nvm ls-remote` output so the order is: "pre-merged", "iojs", "post-merged".
parent
d4caf9fb67
commit
1e2a7a8de4
15
nvm.sh
15
nvm.sh
|
@ -1759,10 +1759,16 @@ nvm() {
|
||||||
|
|
||||||
local NVM_LS_REMOTE_EXIT_CODE
|
local NVM_LS_REMOTE_EXIT_CODE
|
||||||
NVM_LS_REMOTE_EXIT_CODE=0
|
NVM_LS_REMOTE_EXIT_CODE=0
|
||||||
local NVM_LS_REMOTE_OUTPUT
|
local NVM_LS_REMOTE_PRE_MERGED_OUTPUT
|
||||||
NVM_LS_REMOTE_OUTPUT=''
|
NVM_LS_REMOTE_PRE_MERGED_OUTPUT=''
|
||||||
|
local NVM_LS_REMOTE_POST_MERGED_OUTPUT
|
||||||
|
NVM_LS_REMOTE_POST_MERGED_OUTPUT=''
|
||||||
if [ "_$NVM_FLAVOR" != "_$NVM_IOJS_PREFIX" ]; then
|
if [ "_$NVM_FLAVOR" != "_$NVM_IOJS_PREFIX" ]; then
|
||||||
|
local NVM_LS_REMOTE_OUTPUT
|
||||||
NVM_LS_REMOTE_OUTPUT=$(nvm_ls_remote "$PATTERN")
|
NVM_LS_REMOTE_OUTPUT=$(nvm_ls_remote "$PATTERN")
|
||||||
|
# split output into two
|
||||||
|
NVM_LS_REMOTE_PRE_MERGED_OUTPUT="${NVM_LS_REMOTE_OUTPUT%%v4\.0\.0*}"
|
||||||
|
NVM_LS_REMOTE_POST_MERGED_OUTPUT="${NVM_LS_REMOTE_OUTPUT#$NVM_LS_REMOTE_PRE_MERGED_OUTPUT}"
|
||||||
NVM_LS_REMOTE_EXIT_CODE=$?
|
NVM_LS_REMOTE_EXIT_CODE=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -1776,8 +1782,9 @@ nvm() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local NVM_OUTPUT
|
local NVM_OUTPUT
|
||||||
NVM_OUTPUT="$(echo "$NVM_LS_REMOTE_OUTPUT
|
NVM_OUTPUT="$(echo "$NVM_LS_REMOTE_PRE_MERGED_OUTPUT
|
||||||
$NVM_LS_REMOTE_IOJS_OUTPUT" | command grep -v "N/A" | command sed '/^$/d')"
|
$NVM_LS_REMOTE_IOJS_OUTPUT
|
||||||
|
$NVM_LS_REMOTE_POST_MERGED_OUTPUT" | command grep -v "N/A" | command sed '/^$/d')"
|
||||||
if [ -n "$NVM_OUTPUT" ]; then
|
if [ -n "$NVM_OUTPUT" ]; then
|
||||||
nvm_print_versions "$NVM_OUTPUT"
|
nvm_print_versions "$NVM_OUTPUT"
|
||||||
return $NVM_LS_REMOTE_EXIT_CODE || $NVM_LS_REMOTE_IOJS_EXIT_CODE
|
return $NVM_LS_REMOTE_EXIT_CODE || $NVM_LS_REMOTE_IOJS_EXIT_CODE
|
||||||
|
|
Loading…
Reference in New Issue