Skip to content

Instantly share code, notes, and snippets.

@hjerpbakk
Created September 1, 2012 14:10
Show Gist options
  • Save hjerpbakk/3574215 to your computer and use it in GitHub Desktop.
Save hjerpbakk/3574215 to your computer and use it in GitHub Desktop.
Optimize SVG-files, a OS X shell script to be used as a service From http://hjerpbakk.com/blog/2012/9/1/optimize-svg-images-for-retina-displays.html
for f in "$@"
do
if [ ${f: -4} == ".svg" -o ${f: -4} == ".SVG" ]
then
python /Applications/Utilities/scour/scour.py --enable-comment-stripping --create-groups --enable-id-stripping --shorten-ids --set-precision=5 --quiet --indent=none -i "$f" -o "$f 2"
mv "$f 2" "$f"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment