Permalink
Browse files

Add curl/wget detection for OSX/Linux compatibility

  • Loading branch information...
1 parent b5cde2e commit 2d3b4056464c4416756de3ac78a010a0fb0be242 Toni Grigoriu committed Mar 1, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 modman-installer
View
@@ -12,6 +12,18 @@ if [ ! -d "$HOME/bin" ] ; then
fi
fi
-wget -O $HOME/bin/modman https://raw.github.com/colinmollenhour/modman/master/modman
+# test if curl/wget is installed
+if hash curl 2>&- ; then
+ CMD="curl -s -o"
+elif hash wget 2>&- ; then
+ CMD="wget -q -O"
+else
+ echo "You need to have curl or wget installed."
+ exit 1
+fi
+
+$CMD $HOME/bin/modman https://raw.github.com/colinmollenhour/modman/master/modman
chmod +x $HOME/bin/modman
+
+echo "Done. Modman installed in $HOME/bin/modman"

0 comments on commit 2d3b405

Please sign in to comment.