mediawiki-skins-MinervaNeue/dev-scripts/svg_check.sh
Antoine Musso 8a220e372c Make svg_check.sh verbose
So we know what is going on while the CPU is being busy.

Change-Id: I34a7ecadf549833025a197d72ca131888519a92a
2017-12-11 16:50:56 +01:00

21 lines
559 B
Bash
Executable file

#!/usr/bin/env bash
found=0
while read -r svgfile; do
outfile="$svgfile.tmp"
echo -n "Checking compression: $svgfile ... "
node_modules/.bin/svgo --config .svgo.yml -i "$svgfile" -o "$outfile" -q
if [ "$(wc -c < "$svgfile")" -gt "$(wc -c < "$outfile")" ]; then
echo -e "\nERR> file $svgfile is not compressed."
found=$((found + 1))
else
echo "OK"
fi
rm "$outfile"
done < <(find resources -type f -name '*.svg')
if [ $found -gt 0 ]; then
echo "Found $found uncompressed SVG files. Please compress the files and re-submit the patch."
exit 1
fi