Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
38 changes: 38 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
#:Tital: install.sh
#:Synopsis: install.sh
#:Date: 2013-01-26
#:Version: 1.0
#:Author: lovvvve
#:Mail: [email protected]
#: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