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.
master
Caio Romão 2012-01-18 17:43:28 -02:00
parent ec2327fddd
commit 53cfd2dd9b
1 changed files with 1 additions and 1 deletions

2
nvm.sh
View File

@ -283,4 +283,4 @@ nvm()
esac esac
} }
nvm ls default >/dev/null 2>&1 && nvm use default >/dev/null nvm ls default &>/dev/null && nvm use default >/dev/null || true