Last active
August 29, 2015 14:24
-
-
Save lostrouter/695fb94cf7510fae77c9 to your computer and use it in GitHub Desktop.
bash script wrapping nvm to provide almost certain way to use specified version of node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne 1 ]; then | |
echo "incorrect usage" | |
echo "Usage:" | |
echo " SetNodeVersion <VERSION>" | |
exit -1 | |
fi | |
NODE_VERSION=$1 | |
export NVM_DIR="${HOME}/.nvm" | |
[ -s "${NVM_DIR}/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
nvm use ${NODE_VERSION} || nvm install ${NODE_VERSION} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment