From b860a3864d88c67ae09b8170332b36b731f06198 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Fri, 10 Apr 2026 12:50:12 +0100 Subject: [PATCH] Improve output of playwright-screenshots script (#33098) * Improve output of playwright-screenshots script * Address review feedback --- packages/playwright-common/playwright-screenshots.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/playwright-common/playwright-screenshots.sh b/packages/playwright-common/playwright-screenshots.sh index 7fc1a1fa33..ecf962f112 100755 --- a/packages/playwright-common/playwright-screenshots.sh +++ b/packages/playwright-common/playwright-screenshots.sh @@ -19,8 +19,15 @@ WS_PORT=3000 PW_VERSION=$(pnpm --silent -- playwright --version | awk '{print $2}') IMAGE_NAME="ghcr.io/element-hq/element-web/playwright-server:$PW_VERSION" -# Pull the image, failing that build the image -docker pull "$IMAGE_NAME" 2>/dev/null || build_image "$IMAGE_NAME" +# If the image exists in the repository, pull it; otherwise, build it. +# +# (This explicit test gives the user clearer progress info than just +# `docker pull 2>/dev/null || build_image`.) +if docker manifest inspect "$IMAGE_NAME" &>/dev/null; then + docker pull "$IMAGE_NAME" +else + build_image "$IMAGE_NAME" +fi # Start the playwright-server in docker CONTAINER=$(docker run --network=host -v /tmp:/tmp --rm -d -e PORT="$WS_PORT" "$IMAGE_NAME")