Skip to content

Instantly share code, notes, and snippets.

@arlando
Created December 3, 2013 18:34
Show Gist options
  • Save arlando/7774834 to your computer and use it in GitHub Desktop.
Save arlando/7774834 to your computer and use it in GitHub Desktop.
a pre-push hook that calls grunt build when pushing to master for mac osx bash
#!/bin/sh
PATH="/usr/local/bin:/usr/local/share/npm/bin/grunt:$PATH"
echo "Running Pre-Push Hook..."
#check to see if we are on the heavenly master branch
if [ "`git branch | grep \* | cut -f2 -d' '`" == "master" ]
then
echo "Push to master branch ... building dist... pushing to website"
#force repo to build then push the sucka to master
grunt build
say -v Alex "Push was successful!"
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment