Skip to content

Instantly share code, notes, and snippets.

@waltflanagan
Created December 14, 2011 03:05
Show Gist options
  • Save waltflanagan/1475081 to your computer and use it in GitHub Desktop.
Save waltflanagan/1475081 to your computer and use it in GitHub Desktop.
Install mac hubot
#!/bin/bash -e
# don't blunder on if an error occurs
set -e
# get configured
echo "Welcome to the TSC Hubot install script!"
read -ep "What hubot git should we install? " HUBOT_REPO
HUBOT_REPO=${HUBOT_REPO:-"git://github.com/TechSmith/hubot.git"}
read -ep "Where should it be checked out? " HUBOT_NAME
HUBOT_NAME=${HUBOT_NAME:-hubot}
read -ep "What hubot settings gist should we use? " HUBOT_SETTINGS
HUBOT_SETTINGS=${HUBOT_SETTINGS:-"https://gist.github.com/raw/1453453/hubot-scripts.json"}
echo "Beginning installation with settngs:"
echo $HUBOT_REPO
echo $HUBOT_NAME
echo $HUBO_SETTINGS
read -ep "Install Node?" SHOULDINSTALL
INSTALLNODE=0
if [ `echo $SHOULDINSTALL | tr [:upper:] [:lower:]` = y ]
then INSTALLNODE=1
fi
if [ $INSTALLNODE != 0 ]
then
echo "Installing Node"
sudo port install nodejs
echo "Installing npm"
sudo port install npm
fi
echo "Checking out hubot (hubba hubba)"
git clone $HUBOT_REPO
echo "initializing dependencies"
cd hubot
npm install
sudo npm install -g coffee-script
echo "making hubots package"
make package
cd hubot
rm hubot-scripts.json
wget $HUBOT_SETTINGS --no-check-certificate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment