Skip to content

Instantly share code, notes, and snippets.

@siddMahen
Created February 24, 2012 22:36
Show Gist options
  • Save siddMahen/1904245 to your computer and use it in GitHub Desktop.
Save siddMahen/1904245 to your computer and use it in GitHub Desktop.
Gets the specified version of node.js and installs it
#!/bin/bash -e
# Installs the specified version of node.js
# Usage:
# node_update [v]0.0.0
base_dir=$HOME/GitProjects
restore=$PWD
if [ $# -ne 1 ]
then
echo -e "Usage:\n `basename $0` [v]0.0.0"
exit 1
fi
if [[ $1 == v* ]] ;
then
version=$1
else
version={$1:1}
fi
cd $base_dir
git clone git://github.com/joyent/node.git ./node_update
cd ./node_update
git checkout $version
./configure
make
make install
cd $base_dir
sudo rm -R ./node_update
cd $restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment