From 1a7dec1d3eca347c712dd6c026c1cfa858ecd733 Mon Sep 17 00:00:00 2001 From: Lovvvve Date: Sun, 27 Jan 2013 00:31:42 +0800 Subject: [PATCH 1/2] add install.sh --- install.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..4d3152d --- /dev/null +++ b/install.sh @@ -0,0 +1,38 @@ +#!/bin/bash +#:Tital: install.sh +#:Synopsis: install.sh +#:Date: 2013-01-26 +#:Version: 1.0 +#:Author: lovvvve +#:Mail: lovvvve@gmail.com +#:Options: + +node_js_url=http://nodejs.org/dist/v0.8.18/node-v0.8.18.tar.gz +node_js_file=`echo $node_js_url | awk -F '/' '{print $NF}'` +node_js_dir=`echo $node_js_file | awk -F '.tar' '{print $1}'` + +if [ $(id -u) != "0" ]; then + echo -e "Error: You must be root to run this script." + exit 1 +fi + +which npm &>/dev/null +if [ $? -gt 0 ]; then + echo -e "Error:npm node not found,download now......" + cd /opt/ + wget $node_js_url + tar xf $node_js_file + cd $node_js_dir + ./configure && make && make install + +fi + +which ask &>/dev/null +if [ $? -eq 0 ] ;then + echo "ask is exist,you need rename our ask name:" + read -p "input newname:" newname + echo $newname + mv bin/ask bin/$newname +fi +cd /opt/ask/ +npm install From 3500f48f018d2f824de80a623723fa1fc36a1d45 Mon Sep 17 00:00:00 2001 From: Lovvvve Date: Sun, 27 Jan 2013 01:16:28 +0800 Subject: [PATCH 2/2] one line install --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 1758796..c8c3988 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,9 @@ You could share more commands right from terminal with your `$EDITOR`: ask add +##Install +- `curl -L https://raw.github.com/lovvvve/ask/master/install.sh | sh` + ## Details More useful options are: