Skip to content

Instantly share code, notes, and snippets.

@bassettsj
Created August 30, 2014 16:01
Show Gist options
  • Save bassettsj/f4cc881775f4beaee25c to your computer and use it in GitHub Desktop.
Save bassettsj/f4cc881775f4beaee25c to your computer and use it in GitHub Desktop.
Git hooks to compile the assets to production
#!/bin/sh
echo
if [ -a .commit ]
then
rm .commit
grunt --base=$HOME/kalabox/www/greenbiz/sites/all/themes/greenbiz --gruntfile=$HOME/kalabox/www/greenbiz/sites/all/themes/greenbiz/Gruntfile.coffee
git add sites/all/themes/greenbiz/css
git add sites/all/themes/greenbiz/js/dist
git add sites/all/themes/greenbiz/styleguide
git commit --amend -C HEAD --no-verify
fi
exit
#!/bin/sh
echo
touch .commit
exit
@bassettsj
Copy link
Author

  • $GREENBIZ/.git/hooks/{WE GO HERE}
  • chmod u+x .git/hooks/pre-commit
  • chmod u+x .git/hooks/post-commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment