mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 17:00:37 +00:00
build: Make 'svg_check.sh' script executable and change to tabs
Change-Id: I276b7ec65dc4e15960883afd85fd56e6c7b9f3b7
This commit is contained in:
parent
51e976ae2b
commit
4c1d1ba39f
22
dev-scripts/svg_check.sh
Normal file → Executable file
22
dev-scripts/svg_check.sh
Normal file → Executable file
|
@ -1,17 +1,17 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
found=0
|
found=0
|
||||||
for svgfile in `find resources -type f -name "*.svg"`; do
|
for svgfile in `find resources -type f -name "*.svg"`; do
|
||||||
outfile="$svgfile.tmp"
|
outfile="$svgfile.tmp"
|
||||||
node_modules/.bin/svgo --config .svgo.config.js -i $svgfile -o $outfile -q
|
node_modules/.bin/svgo --config .svgo.config.js -i $svgfile -o $outfile -q
|
||||||
if [ -f $outfile ]; then
|
if [ -f $outfile ]; then
|
||||||
if [ $(wc -c $svgfile | awk '{print $1}') -gt $(wc -c $outfile | awk '{print $1}') ]; then
|
if [ $(wc -c $svgfile | awk '{print $1}') -gt $(wc -c $outfile | awk '{print $1}') ]; then
|
||||||
echo "File $svgfile is not compressed"
|
echo "File $svgfile is not compressed"
|
||||||
found=$((found + 1))
|
found=$((found + 1))
|
||||||
fi
|
fi
|
||||||
rm $outfile
|
rm $outfile
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ $found -gt 0 ]; then
|
if [ $found -gt 0 ]; then
|
||||||
echo "Found $found uncompressed SVG files. Please compress the files and re-submit the patch"
|
echo "Found $found uncompressed SVG files. Please compress the files and re-submit the patch"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue