Created
January 9, 2015 04:21
-
-
Save paularmstrong/e1637d7704a79ecf90e6 to your computer and use it in GitHub Desktop.
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/bash | |
# Optimize PNGs | |
for file in `git diff --cached --name-only | grep ".png\$"`; do | |
echo "Crushing $file" | |
pngcrush -rem allb -brute -reduce $file ${file%.png}.new 2>&1 | grep "filesize" | |
mv -f ${file%.png}.new $file | |
git add $file | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment