Permalink
Browse files

Merge pull request #5 from pseudomuto/install_script

Installation Script
  • Loading branch information...
2 parents 2f37c7c + c30ba59 commit 4223980f76020d1cfb1c384c81a1b577b286e80d @cobyism committed Aug 22, 2013
Showing with 47 additions and 4 deletions.
  1. +1 −0 .gitignore
  2. +9 −4 README.md
  3. 0 { → bin}/octocatsay
  4. +37 −0 install.sh
View
@@ -0,0 +1 @@
+.DS_Store
View
@@ -4,9 +4,9 @@ Octocatsay
You know [cowsay](http://www.nog.net/~tony/warez/cowsay.shtml), right? Well...
```sh
-$ git clone git://github.com/cobyism/octocatsay.git
-$ cd octocatsay
-$ ./octocatsay 'BOOYAH!'
+$ curl https://raw.github.com/cobyism/octocatsay/master/install.sh | $(which bash)
+$ source ~/.bashrc
+$ octocatsay 'BOOYAH!'
$
MMM. .MMM
@@ -63,8 +63,13 @@ Do what you like with this, however remember that the Octocat is a trademark
owned by [GitHub](https://github.com/). See their [Octocat usage
F.A.Q.](http://octodex.github.com/faq.html) for what you can and can't do.
+## Installation
+
+Run the following from a shell:
+
+ $ curl https://raw.github.com/cobyism/octocatsay/master/install.sh | $(which bash)
+
## TODO
-- Make it so that it's something you can actually install on your system, rather than just a script you run.
- Create an `octocathink` version like `cowthink`.
- Do a better job on the ASCII, especially the negative space around the eyes.
File renamed without changes.
View
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+SCRIPT_FILE=https://raw.github.com/cobyism/octocatsay/master/bin/octocatsay
+APP_DIR=.octocatsay
+
+# allow param for testing...
+INSTALL_DIR=${1:-$HOME}
+
+echo "Installing into $INSTALL_DIR/$APP_DIR..."
+
+[ -d $INSTALL_DIR ] || mkdir -p $INSTALL_DIR
+
+cd $INSTALL_DIR
+
+# ensure the bin folder exists
+
+if [ ! -d $APP_DIR ]; then
+ mkdir -p $APP_DIR/bin
+fi
+
+cd $APP_DIR/bin
+
+# get the file and save (overwriting if needed)
+curl $SCRIPT_FILE > octocatsay
+
+# update path (if necessary)
+
+if [ ! $(echo $PATH | fgrep "$INSTALL_DIR/$APP_DIR/bin") ] ; then
+ echo "Adding $APP_DIR to PATH."
+ echo "PATH=$INSTALL_DIR/$APP_DIR/bin:\$PATH" >> ~/.bashrc
+ echo "PATH=$INSTALL_DIR/$APP_DIR/bin:\$PATH" >> ~/.bash_profile
+ source ~/.bashrc
+
+ echo "run 'source ~/.bashrc' to update path in the current shell."
+fi
+
+echo "All done."

0 comments on commit 4223980

Please sign in to comment.