From 7ada56c8e235cf1188fb4d6cb53f609968c0c0d0 Mon Sep 17 00:00:00 2001 From: Niloth P <20315308+Niloth-p@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:41:36 +0530 Subject: [PATCH] optimize-svg: Invoke svgo only via PNPM. --- tools/setup/optimize-svg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/setup/optimize-svg b/tools/setup/optimize-svg index 899d876dd4..2dd1afda52 100755 --- a/tools/setup/optimize-svg +++ b/tools/setup/optimize-svg @@ -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