Created
January 2, 2019 15:54
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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