From 53cfd2dd9b55d77f58ce6453c3be8aa60827265c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caio=20Rom=C3=A3o?= Date: Wed, 18 Jan 2012 17:43:28 -0200 Subject: [PATCH] Avoid carrying over test status when no node version is installed When sourcing nvm.sh, if there are no version of node installed the command `nvm ls default` silentry fails, however it's return status code (`$?`) is still set to non-zero, which means an error. This patch simply avoids this issue by making sure the status code after sourcing is ok so that people that put the returned status codes in their command line prompt don't get an error every time `nvm.sh` is sourced. --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index 6d589d8..831db6b 100755 --- a/nvm.sh +++ b/nvm.sh @@ -283,4 +283,4 @@ nvm() esac } -nvm ls default >/dev/null 2>&1 && nvm use default >/dev/null +nvm ls default &>/dev/null && nvm use default >/dev/null || true