Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hjerpbakk/3305910 to your computer and use it in GitHub Desktop.
Save hjerpbakk/3305910 to your computer and use it in GitHub Desktop.
Script to be used as an OS X service that optimizes .svg-files using the scour Python script 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