bin/svg-optimize: add --no-svgcleaner

This commit is contained in:
Niklas Fiekas 2017-01-26 17:47:03 +01:00
parent 41c649d2dd
commit 9139fa50a1

View file

@ -1,13 +1,23 @@
#!/bin/bash -e
# For extra optimizations install https://github.com/RazrFalcon/svgcleaner
# and set this variable.
# SVGCLEANER=svgcleaner/target/release/svgcleaner
# or
# SVGCLEANER=svgcleaner
# Uses svgo and also https://github.com/RazrFalcon/svgcleaner unless run with
# --no-svgcleaner.
SVGCLEANER=svgcleaner
SVGO=./node_modules/svgo/bin/svgo
for opt in "$@"; do
case $opt in
--no-svgcleaner)
unset SVGCLEANER
;;
*)
echo "Unknown option: $opt"
exit 129
;;
esac
done
svgo_optimize() {
echo "$1 -> $2"
$SVGO --quiet --multipass -i "$1" -o "$2"