Skip to content

Instantly share code, notes, and snippets.

@Neener54
Created June 6, 2016 15:45
Show Gist options
  • Save Neener54/39cb750b807ce2d6eeb8a363bb0f43ea to your computer and use it in GitHub Desktop.
Save Neener54/39cb750b807ce2d6eeb8a363bb0f43ea to your computer and use it in GitHub Desktop.
Setup Script for Nav Projects
#!/usr/bin/env bash
NODE_VERSION=4.4.4
DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}")" && pwd)"
which -s brew
if [[ $? != 0 ]] ; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
brew update
fi
which -s git || brew install git
echo "Checking for Node version ${NODE_VERSION}"
node --version | grep ${NODE_VERSION}
if [[ $? != 0 ]] ; then
cd `brew --prefix`
$(brew versions node | grep ${NODE_VERSION} | cut -c 16- -)
brew install node
git reset HEAD `brew --repository` && git checkout -- `brew --repository`
fi
shell_session_update() { :; }
echo "Checking ruby version"
which -s rvm | gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && curl -sSL https://get.rvm.io | bash -s stable
source "$HOME/.rvm/scripts/rvm"
rvm install ruby
rvm use ruby --default
echo "Checking NVM"
which -s nvm | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment