Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding install script

  • Loading branch information...
commit 66531b580a70b5449a39f2b9983ad9b5ff960439 1 parent 4b92433
@pseudomuto pseudomuto authored
Showing with 36 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +35 −0 install.sh
View
1  .gitignore
@@ -0,0 +1 @@
+.DS_Store
View
35 install.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+SOURCE_REPO=https://github.com/pseudomuto/octocatsay.git
+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
+
+# clone/update the repo
+
+if [ -d $APP_DIR ]; then
+ cd $APP_DIR
+ echo "Already installed. Updating from origin..."
+ git pull origin master
+else
+ git clone $SOURCE_REPO $APP_DIR
+fi
+
+# update path (if necessary)
+
+if [ ! $(echo $PATH | fgrep "$INSTALL_DIR/$APP_DIR/bin") ] ; then
+ echo "Adding $APP_DIR to PATH."
+ echo "PATH=$INSTALL_DIR/.ghf/bin:\$PATH" >> ~/.bashrc
+ source ~/.bashrc
+
+ echo "run 'source ~/.bashrc' to update path in the current shell."
+fi
+
+echo "All done."
Please sign in to comment.
Something went wrong with that request. Please try again.