#!/usr/bin/env bash

function recursive_optimize_images() {
cd $1;
optipng -o6 -strip all *.png;
jpegoptim --strip-all *.jpg;
for svg in `ls *.svg`;
do
    mv $svg $svg.opttmp;
    scour --create-groups --enable-id-stripping --enable-comment-stripping --shorten-ids --remove-metadata --strip-xml-prolog --no-line-breaks  -i $svg.opttmp -o $svg;
done;
rm *.opttmp
for dir in `ls -d */`;
do
    recursive_optimize_images $dir;
    cd ..;
done;
}

recursive_optimize_images ../

#!/usr/bin/env bash

function recursive_optimize_images() {
cd $1;
optipng -o6 -strip all *.png;
jpegoptim --strip-all *.jpg;
for svg in `ls *.svg`;
do
    mv $svg $svg.opttmp;
    scour -i $svg.opttmp -o $svg --create-groups --enable-id-stripping --enable-comment-stripping --shorten-ids --remove-metadata --strip-xml-prolog --no-line-breaks;
done;
rm *.opttmp
for dir in `ls -d */`;
do
    recursive_optimize_images $dir;
    cd ..;
done;
}

recursive_optimize_images ../

--- 
+++ 
@@ -7,7 +7,7 @@
 for svg in `ls *.svg`;
 do
     mv $svg $svg.opttmp;
-    scour -i $svg.opttmp -o $svg --create-groups --enable-id-stripping --enable-comment-stripping --shorten-ids --remove-metadata --strip-xml-prolog --no-line-breaks;
+    scour --create-groups --enable-id-stripping --enable-comment-stripping --shorten-ids --remove-metadata --strip-xml-prolog --no-line-breaks  -i $svg.opttmp -o $svg;
 done;
 rm *.opttmp
 for dir in `ls -d */`;
Switch around syntax of scour command for SVG image optimization

Signed-off-by: Jan-Christoph Borchardt <7f550a9f4c44173a37664d938f1355f0f92a47a7@jancborchardt.net>
