mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-14 09:54:45 +00:00
db97b4e202
Also * Simplify wc. * Add period at end of sentences. * Use tabs instead of spaces for indenting. * Add newline at end of file. Change-Id: I50a9d31acecc32bcf693cba5022152aa9abcbaab
19 lines
474 B
Bash
Executable file
19 lines
474 B
Bash
Executable file
#!/usr/bin/env bash
|
|
found=0
|
|
|
|
find resources -type f -name '*.svg' |
|
|
while read svgfile; do
|
|
outfile="$svgfile.tmp"
|
|
node_modules/.bin/svgo --config .svgo.yml -i "$svgfile" -o "$outfile" -q
|
|
if [ $(wc -c < "$svgfile") -gt $(wc -c < "$outfile") ]; then
|
|
echo "File $svgfile is not compressed."
|
|
found=$((found + 1))
|
|
fi
|
|
rm "$outfile"
|
|
done
|
|
|
|
if [ $found -gt 0 ]; then
|
|
echo "Found $found uncompressed SVG files. Please compress the files and re-submit the patch."
|
|
exit 1
|
|
fi
|