optimize-svg: Invoke svgo only via PNPM.

This commit is contained in:
Niloth P 2024-11-18 12:41:36 +05:30 committed by Tim Abbott
parent cd55488487
commit 7ada56c8e2
1 changed files with 2 additions and 1 deletions

View File

@ -45,7 +45,8 @@ ZULIP_PATH="$(readlink -f "$(dirname "$0")"/../..)"
PNPM="/usr/local/bin/pnpm"
if [ -n "$CHECK_UNOPTIMIZED" ]; then
if [ "$(node_modules/.bin/svgo -f static/images/integrations/logos | grep -o '\.[0-9]% = ' | wc -l)" -ge 1 ]; then
RESULT=$("$PNPM" exec svgo -f static/images/integrations/logos | grep -o '\.[0-9]% = ' | wc -l)
if [ "$RESULT" -ge 1 ]; then
echo "ERROR: svgo detected unoptimized SVG files in the \`static/images/integrations/logos\` folder." 1>&2
echo "Please run tools/setup/optimize-svg and commit the file changes to optimize them."
exit 1