2016-02-14 18:07:10 +08:00
|
|
|
#!/usr/bin/env bash
|
2013-12-07 07:39:34 +08:00
|
|
|
|
|
|
|
DIR="$(command cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
2016-11-04 13:15:18 +08:00
|
|
|
\. "$DIR/nvm.sh" --no-use
|
2013-12-07 07:39:34 +08:00
|
|
|
|
2014-04-26 01:38:21 +08:00
|
|
|
if [ -n "$NODE_VERSION" ]; then
|
2016-02-05 03:19:34 +08:00
|
|
|
nvm use $NODE_VERSION > /dev/null || exit 127
|
|
|
|
elif ! nvm use >/dev/null 2>&1; then
|
|
|
|
echo "No NODE_VERSION provided; no .nvmrc file found" >&2
|
|
|
|
exit 127
|
2013-12-07 07:39:34 +08:00
|
|
|
fi
|
|
|
|
|
2015-12-24 18:16:13 +08:00
|
|
|
exec "$@"
|