Skip to content

Instantly share code, notes, and snippets.

@phaustin
Created January 2, 2019 15:54
Show Gist options
  • Save phaustin/39c6ff5198bb5cad5d4fd5fb0cdbaf07 to your computer and use it in GitHub Desktop.
Save phaustin/39c6ff5198bb5cad5d4fd5fb0cdbaf07 to your computer and use it in GitHub Desktop.
Pre and post commit hooks to automatically generate production ready css and add it to the current commit. git add doesn't add the files to the current commit so a .commit file is created to keep track and execute an amending commit in a post-commit hook
#!/bin/sh
#
# To enable this hook place this file in .git/hooks and make it executable.
if [ -a .commit ]
then
rm .commit
git commit --amend -C HEAD --no-verify
fi
exit
#!/bin/sh
##
# To enable this hook place this file in .git/hooks and make it executable.
compass compile -e production --force sites/all/themes/ggw_int
git add sites/all/themes/ggw_int
touch .commit
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment