Files
zulip/tools/setup/optimize-svg
Anders Kaseorg 392175d6e8 Use #!/usr/bin/env for bash shebangs.
/bin/sh and /usr/bin/env are the only two binaries that NixOS provides
at a fixed path (outside a buildFHSUserEnv sandbox).

This discussion was split from #11004.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2018-12-17 17:21:08 -08:00

11 lines
460 B
Bash
Executable File

#!/usr/bin/env 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