Permalink
Browse files

Merge branch 'master' of github.com:fireteam/curlish

  • Loading branch information...
2 parents 3caa7fc + ca5743a commit 71f3ce2f589ad4719939865e965ed008f835e5f1 @mitsuhiko mitsuhiko committed May 4, 2012
Showing with 18 additions and 9 deletions.
  1. +1 −1 curlish.py
  2. +17 −8 install.sh
View
2 curlish.py
@@ -889,7 +889,7 @@ def main():
try:
args, extra_args = parser.parse_known_args()
- except Exception as e:
+ except Exception, e:
print e
sys.exit(1)
View
25 install.sh
@@ -1,17 +1,26 @@
#!/bin/bash
-CURL=`which curl`
-if [ x$CURL == x ]; then
+BIN_DIR="~/.bin";
+if [ -n "$1" ]; then
+ BIN_DIR="$1";
+fi
+
+echo $BIN_DIR;
+
+CURL=curl
+
+if [ -z $(which "$CURL") ]; then
echo 'error: curl required to use curlish. Please install it first.'
exit 1
fi
echo 'Downloading curlish...'
-mkdir -p ~/.bin
-curl -s https://raw.github.com/fireteam/curlish/master/curlish.py > ~/.bin/curlish
-chmod +x ~/.bin/curlish
+mkdir -p $BIN_DIR
+curl -s https://raw.github.com/fireteam/curlish/master/curlish.py > $BIN_DIR/curlish
+chmod +x $BIN_DIR/curlish
echo
-echo "Curlish installed successfully to ~/.bin/curlish"
-echo "Add ~/.bin to your PATH if you haven't so far:"
+echo "Curlish installed successfully to $BIN_DIR/curlish"
+echo "Add $BIN_DIR to your PATH if you haven't so far:"
echo
-echo $' echo \'export PATH="$PATH:~/.bin"\' >> ~/.bashrc'
+echo -n $' echo \'export PATH="$PATH:';
+echo "$BIN_DIR\"' >> ~/.bashrc";

0 comments on commit 71f3ce2

Please sign in to comment.