Created
February 24, 2012 22:36
-
-
Save siddMahen/1904245 to your computer and use it in GitHub Desktop.
Gets the specified version of node.js and installs it
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 -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