2012-03-13 15:50:55 +00:00
|
|
|
#!/bin/bash
|
2012-03-13 16:11:29 +00:00
|
|
|
# For Ubuntu: apt-get install libavahi-compat-libdnssd-dev
|
2012-03-13 15:50:55 +00:00
|
|
|
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"
|
2012-05-25 11:16:10 +00:00
|
|
|
sudo apt-get install python-software-properties
|
|
|
|
sudo apt-add-repository ppa:chris-lea/node.js
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install nodejs npm
|
2012-03-13 15:50:55 +00:00
|
|
|
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
|