From f3d1770e3ec1b1e2dbe04ec3adca5304ba45df3c Mon Sep 17 00:00:00 2001 From: Koen Punt Date: Sat, 7 Dec 2013 00:39:34 +0100 Subject: [PATCH] nvm exec wrapper to execute commands with a specific node version --- nvm-exec | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 nvm-exec diff --git a/nvm-exec b/nvm-exec new file mode 100755 index 0000000..08b62ce --- /dev/null +++ b/nvm-exec @@ -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 $@ \ No newline at end of file