Ignore errors when sourcing nvm.sh

It fails spuriously if it fails to understand the version of system node.
This commit is contained in:
Thomas Goyne 2017-09-18 21:08:19 -07:00
parent e1f3cd638f
commit d04a45b8d1
1 changed files with 2 additions and 0 deletions

View File

@ -233,6 +233,7 @@ trap cleanup EXIT
# Use a consistent version of Node if possible. # Use a consistent version of Node if possible.
if [[ -z "$(command -v nvm)" ]]; then if [[ -z "$(command -v nvm)" ]]; then
set +e
if [ -f "$NVM_DIR/nvm.sh" ]; then if [ -f "$NVM_DIR/nvm.sh" ]; then
. "$NVM_DIR/nvm.sh" '' || true . "$NVM_DIR/nvm.sh" '' || true
elif [ -x "$(command -v brew)" ] && [ -f "$(brew --prefix nvm)/nvm.sh" ]; then elif [ -x "$(command -v brew)" ] && [ -f "$(brew --prefix nvm)/nvm.sh" ]; then
@ -242,6 +243,7 @@ if [[ -z "$(command -v nvm)" ]]; then
elif [ -f "$HOME/.nvm/nvm.sh" ]; then elif [ -f "$HOME/.nvm/nvm.sh" ]; then
. ~/.nvm/nvm.sh '' . ~/.nvm/nvm.sh ''
fi fi
set -e
fi fi
if [[ "$(command -v nvm)" ]]; then if [[ "$(command -v nvm)" ]]; then
nvm install 6.5.0 nvm install 6.5.0