mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-27 23:50:30 +00:00
8a220e372c
So we know what is going on while the CPU is being busy. Change-Id: I34a7ecadf549833025a197d72ca131888519a92a
21 lines
559 B
Bash
Executable file
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
|