From ee1a4ead8850201e319aa8fceb520ba22f1113f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2EFernando=20S=C3=A1nchez?= Date: Tue, 13 Mar 2012 16:50:55 +0100 Subject: [PATCH] Added installation script --- install.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..af66719 --- /dev/null +++ b/install.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +function fetch(){ + echo "Fetching project from Github" + git clone https://github.com/balkian/Web4.0.git Web4.0 + cd Web4.0 +} +function install_npm(){ + echo "Installing NPM" + curl http://npmjs.org/install.sh | sudo sh +} +function install_node(){ + echo "Instaling nodejs" + sudo apt-get install nodejs-dev + #sudo sudo npm install hook.io + #sudo npm install hookio/hooks/* +} +function install_package(){ + echo "Installing npm package" + sudo npm install $1 +} + +while getopts ":agupi" opt;do + case $opt in + a) + fetch; + install_node; + install_npm; + install_package .; + ;; + g) + fetch; + ;; + u) + install_npm; + ;; + p) + install_package; + ;; + i) + install_npm; + install_node; + ;; + \?) + echo "Probably you want to run $0 -a" + + ;; + esac +done