From 5b3d2a9e593c9f83a0e1f9ba988139ee6aa57285 Mon Sep 17 00:00:00 2001 From: Niloth P <20315308+Niloth-p@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:49:37 +0530 Subject: [PATCH] optimize-svg: Use a constant FILE_PATH, remove path from echo output. --- tools/setup/optimize-svg | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/setup/optimize-svg b/tools/setup/optimize-svg index 2dd1afda52..78ecebbe11 100755 --- a/tools/setup/optimize-svg +++ b/tools/setup/optimize-svg @@ -43,17 +43,18 @@ fi ZULIP_PATH="$(readlink -f "$(dirname "$0")"/../..)" PNPM="/usr/local/bin/pnpm" +FILE_PATH="static/images/integrations/logos" if [ -n "$CHECK_UNOPTIMIZED" ]; then - RESULT=$("$PNPM" exec svgo -f static/images/integrations/logos | grep -o '\.[0-9]% = ' | wc -l) + RESULT=$("$PNPM" exec svgo -f "$FILE_PATH" | 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 "ERROR: svgo detected unoptimized SVG file(s)." 1>&2 echo "Please run tools/setup/optimize-svg and commit the file changes to optimize them." exit 1 else - echo "SUCCESS: SVG files in static/images/integrations/logos are all optimized!" + echo "SUCCESS: SVG file(s) are optimized!" fi else - "$PNPM" exec svgo -q -f static/images/integrations/logos + "$PNPM" exec svgo -q -f "$FILE_PATH" "$ZULIP_PATH"/tools/setup/generate_integration_bots_avatars.py fi