Skip to content

Instantly share code, notes, and snippets.

@codenamezjames
Created March 14, 2016 16:35
Show Gist options
  • Save codenamezjames/412b2b8ea4c25f5c814e to your computer and use it in GitHub Desktop.
Save codenamezjames/412b2b8ea4c25f5c814e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
nodeVersion="5.0";
echo "###############################################################"
echo "###############################################################"
echo "Installing NVM, Node version $nodeVersion and the latest version of gulp"
echo "###############################################################"
echo "###############################################################"
if [ "$(uname)" == "Darwin" ]; then
# Do something under Mac OS X platform
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
# Do something under GNU/Linux platform
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
fi
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
if [ -f ~/.bash_profile ]; then
. ~/.bash_profile
fi
nvm install $nodeVersion
nvm use $nodeVersion
nvm alias default $nodeVersion
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
if [ -f ~/.bash_profile ]; then
. ~/.bash_profile
fi
npm install -g gulp
npm install
echo "###############################################################"
echo "If all went well you now have NVM Node and Gulp installed"
echo "Make sure to RESTART YOUR TERMINAL window to use these new tools"
echo "simple usage:"
echo "nvm install 5.1"
echo "node server.js"
echo "gulp"
echo "###############################################################"
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment