Skip to content

Instantly share code, notes, and snippets.

@outbounder
Created September 14, 2011 10:30
Show Gist options
  • Save outbounder/1216273 to your computer and use it in GitHub Desktop.
Save outbounder/1216273 to your computer and use it in GitHub Desktop.
auto-install nvm, node.js
#!/bin/bash
NODE="v0.4.11"
NVMDIR=~/.nvm
NVM=~/.nvm/nvm.sh
echo "installing projectman-repl"
hash nvm 2>&- || {
echo "couldn't find nvm, sourcing from $NVM"
test -e $NVM || {
echo "couldn't find $NVM -> installing..."
hash git 2>&- || {
echo "couldn't find git -> installing..."
sudo apt-get -y install git-core
}
git clone git://github.com/creationix/nvm.git $NVMDIR
}
. $NVM
}
test -e $NVMDIR/$NODE || {
echo "cound't find $NVMDIR/$NODE -> installing..."
sudo apt-get -y install g++ curl libssl-dev apache2-utils
nvm install $NODE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment