nvm exec wrapper to execute commands with a specific node version

master
Koen Punt 2013-12-07 00:39:34 +01:00
parent ba2a850253
commit f3d1770e3e
1 changed files with 14 additions and 0 deletions

14
nvm-exec 100755
View File

@ -0,0 +1,14 @@
#!/bin/bash
DIR="$(command cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$DIR/nvm.sh"
if [ ! "$NODE_VERSION" ]; then
echo 'NODE_VERSION not set'
exit 1
fi
nvm use $NODE_VERSION
exec $@