tools: Add optimize-svg tool for checking for unoptimized SVG files.

This commit is contained in:
Cynthia Lin 2017-05-22 15:11:08 -07:00 committed by Tim Abbott
parent 76537665b9
commit 0600e1eb30
3 changed files with 12 additions and 0 deletions

10
tools/optimize-svg Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
if [ `node_modules/.bin/svgo -f static/images/integrations/logos | grep -o '\.[0-9]% = ' | wc -l` -ge 1 ]
then
echo "ERROR: svgo detected unoptimized SVG files in the \`static/images/integrations/logos\` folder." 1>&2
echo "Please run \`svgo -f static/images/integrations/logos\` and commit the file changes to optimize them."
exit 1
else
echo "SUCCESS: SVG files in static/images/integrations/logos are all optimized!"
fi

View File

@ -39,6 +39,7 @@ run ./tools/test-js-with-node
run ./tools/run-mypy
run ./tools/test-backend $FORCEARG
run ./tools/test-js-with-casper $FORCEARG
run ./tools/optimize-svg
# Not running queue worker reload tests since it's low-churn code
# run ./tools/test-queue-worker-reload
# Not running documentation tests since it takes 20s and only tests documentation

View File

@ -11,6 +11,7 @@ set -x
./tools/test-migrations
# test-run-dev temporarily disabled due to weird Travis CI issues.
#./tools/test-run-dev
./tools/optimize-svg
./tools/test-documentation
./tools/test-help-documentation.py
./tools/test-api