Skip to content

Instantly share code, notes, and snippets.

@acrookston
Last active December 24, 2015 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acrookston/6877276 to your computer and use it in GitHub Desktop.
Save acrookston/6877276 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Depends on pngbai script: https://gist.github.com/acrookston/6877287
# And don't forget to install pngbai's dependencies (documeted there)
FILES=`git diff --name-only origin/master | grep '\.png$'`
for file in $FILES; do
echo "$file"
git add $file
pngbai $file "${file}2"
done
find . -iname *.png2 -exec bash -c 'mv {} `dirname {}`/`basename {} .png2`.png' \;
find . -iname *.png2.png -exec bash -c 'rm {}' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment