2013-12-07 07:39:34 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
DIR="$(command cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
source "$DIR/nvm.sh"
|
|
|
|
|
2014-04-26 01:38:21 +08:00
|
|
|
if [ -n "$NODE_VERSION" ]; then
|
2014-06-18 14:54:14 +08:00
|
|
|
nvm use $NODE_VERSION > /dev/null || (echo "NODE_VERSION not set" >&2 && exit 127)
|
2014-04-26 01:38:21 +08:00
|
|
|
else
|
2014-06-18 14:54:14 +08:00
|
|
|
nvm use > /dev/null || (echo "No .nvmrc file found" >&2 && exit 127)
|
2013-12-07 07:39:34 +08:00
|
|
|
fi
|
|
|
|
|
2014-03-16 02:41:50 +08:00
|
|
|
exec $@
|