Last active
August 29, 2015 14:17
-
-
Save gboone/d1aaa83c68648bef4783 to your computer and use it in GitHub Desktop.
A commit hook to run imageoptim on all images in your assets/ directory
This file contains 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 | |
# | |
# A pre-commit hook that runs Image Optim against all images in the /assets | |
# directory. Requires you have Image Optim installed and will fail silently if | |
# you don't have it installed to /Applications/. Image optim will skip any | |
# images already optimized but this may take time, especially if you've never | |
# run it before or have many images. Rename this pre-commit and move to your | |
# project's .git/hooks/ directory | |
# | |
# /Applications/ImageOptim.app/Contents/MacOS/ImageOptim *.png | |
# | |
# bypass with --no-verify | |
# | |
if test -e /Applications/ImageOptim.app/Contents/MacOS/ImageOptim | |
then | |
/Applications/ImageOptim.app/Contents/MacOS/ImageOptim assets/ | |
else | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment