mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-29 00:20:51 +00:00
Merge "Pass svg_checks.sh via ShellCheck"
This commit is contained in:
commit
8cc57955eb
|
@ -1,16 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
found=0
|
||||
|
||||
find resources -type f -name '*.svg' |
|
||||
while read svgfile; do
|
||||
while read -r 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
|
||||
if [ "$(wc -c < "$svgfile")" -gt "$(wc -c < "$outfile")" ]; then
|
||||
echo "File $svgfile is not compressed."
|
||||
found=$((found + 1))
|
||||
fi
|
||||
rm "$outfile"
|
||||
done
|
||||
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."
|
||||
|
|
Loading…
Reference in a new issue