bin/svg-optimize: add --no-svgcleaner
This commit is contained in:
parent
41c649d2dd
commit
9139fa50a1
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue