mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-12-11 05:46:09 +00:00
a0a69d2d85
Simplify readability and reduce output to errors only on terminal. Also includes suppression for consecutive errors as added in Popups in I5ef7843c9de122c8dce61fbb98737c8acdd0c22c. Change-Id: Ib4705667815cf690e327fdc5f9048c6d6ce779a6
21 lines
562 B
Bash
Executable file
21 lines
562 B
Bash
Executable file
#!/usr/bin/env bash
|
|
found=0
|
|
|
|
for svgfile in `find resources -type f -name "*.svg"`; do
|
|
outfile="$svgfile.tmp"
|
|
echo -n "Checking compression: $svgfile ... "
|
|
node_modules/.bin/svgo --config .svgo.config.js -i "$svgfile" -o "$outfile" -q
|
|
if [ -f $outfile ]; then
|
|
if [ "$(wc -c < "$svgfile")" -gt "$(wc -c < "$outfile")" ]; then
|
|
echo "File $svgfile is not compressed."
|
|
found=$((found + 1))
|
|
fi
|
|
rm "$outfile"
|
|
fi
|
|
done
|
|
|
|
if [ $found -gt 0 ]; then
|
|
echo "Found $found uncompressed SVG files. Please compress the files and re-submit the patch."
|
|
exit 1
|
|
fi
|