Make sure nvm-exec can use .nvmrc logic. Fixes #402, obviates #403.

master
Jordan Harband 2014-04-25 10:38:21 -07:00
parent e6bd207624
commit 0871131dfd
1 changed files with 4 additions and 5 deletions

View File

@ -4,12 +4,11 @@ DIR="$(command cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$DIR/nvm.sh"
if [ ! "$NODE_VERSION" ]; then
echo 'NODE_VERSION not set'
exit 1
if [ -n "$NODE_VERSION" ]; then
nvm use $NODE_VERSION || (echo "NODE_VERSION not set" && exit 127)
else
nvm use || (echo "No .nvmrc file found" && exit 127)
fi
nvm use $NODE_VERSION
exec $@