From 25bd2bb018734f8566e88c96bf64172260021ac2 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 28 Sep 2014 09:41:02 -0700 Subject: [PATCH] Make `nvm ls-remote` return nvm_ls_remote's exit code. --- nvm.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nvm.sh b/nvm.sh index 3e81cad..cf29cef 100644 --- a/nvm.sh +++ b/nvm.sh @@ -296,7 +296,7 @@ nvm_ls() { nvm_ls_remote() { local PATTERN - PATTERN=$1 + PATTERN="$1" local VERSIONS local GREP_OPTIONS GREP_OPTIONS='' @@ -798,8 +798,11 @@ nvm() { return $NVM_LS_EXIT_CODE ;; "ls-remote" | "list-remote" ) - nvm_print_versions "`nvm_ls_remote $2`" - return + local NVM_LS_EXIT_CODE + NVM_LS_OUTPUT=$(nvm_ls_remote "$2") + NVM_LS_EXIT_CODE=$? + nvm_print_versions "$NVM_LS_OUTPUT" + return $NVM_LS_EXIT_CODE ;; "current" ) nvm_version current