mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-04-04 03:54:51 +08:00
[Fix] nvm_ls_remote_combined: propagate iojs remote listing failures
`return $A || $B` only evaluates the first argument, since `return` always succeeds.
The io.js exit code was never checked, silently swallowing remote listing failures.
Bug introduced in ea12784629 / #616.
This commit is contained in:
5
nvm.sh
5
nvm.sh
@@ -878,7 +878,10 @@ ${NVM_LS_REMOTE_POST_MERGED_OUTPUT}" | nvm_grep -v "N/A" | command sed '/^ *$/d'
|
||||
# the `sed` is to remove trailing whitespaces (see "weird behavior" ~25 lines up)
|
||||
nvm_echo "${VERSIONS}" | command sed 's/ *$//g'
|
||||
# shellcheck disable=SC2317
|
||||
return $NVM_LS_REMOTE_EXIT_CODE || $NVM_LS_REMOTE_IOJS_EXIT_CODE
|
||||
if [ "${NVM_LS_REMOTE_EXIT_CODE}" != '0' ]; then
|
||||
return "${NVM_LS_REMOTE_EXIT_CODE}"
|
||||
fi
|
||||
return "${NVM_LS_REMOTE_IOJS_EXIT_CODE}"
|
||||
}
|
||||
|
||||
nvm_is_valid_version() {
|
||||
|
||||
Reference in New Issue
Block a user