Skip to content

Instantly share code, notes, and snippets.

@leibovic
Created November 5, 2014 22:18
Show Gist options
  • Save leibovic/dd8e729a81739b94ff74 to your computer and use it in GitHub Desktop.
Save leibovic/dd8e729a81739b94ff74 to your computer and use it in GitHub Desktop.
pngcrush all changed files in the topmost hg commit
#!/bin/bash
# pngcrushes any changed files in the top-most patch
files=`hg status -n --rev .^`
for f in $files
do
echo $f
pngcrush $f $f.new
mv $f.new $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment