Skip to content

Commit 1825557

Browse files
committed
additional checks
1 parent 20714e1 commit 1825557

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/build/src/extensions/playwright.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,17 @@ class PlaywrightExtension implements BuildExtension {
297297

298298
`RUN INSTALL_DIR=$(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs) && \
299299
DIR_NAME=$(basename "$INSTALL_DIR") && \
300+
if [ -z "$DIR_NAME" ]; then echo "Failed to extract installation directory for ${browser}"; exit 1; fi && \
300301
MS_DIR="/ms-playwright/$DIR_NAME" && \
301302
mkdir -p "$MS_DIR"`,
302303

303304
`RUN DOWNLOAD_URL=$(grep "Download url:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs | sed "s/mac-arm64/linux/g" | sed "s/mac-15-arm64/ubuntu-20.04/g") && \
305+
if [ -z "$DOWNLOAD_URL" ]; then echo "Failed to extract download URL for ${browser}"; exit 1; fi && \
304306
echo "Downloading ${browser} from $DOWNLOAD_URL" && \
305307
curl -L -o /tmp/${browser}.zip "$DOWNLOAD_URL" && \
308+
if [ $? -ne 0 ]; then echo "Failed to download ${browser}"; exit 1; fi && \
306309
unzip -q /tmp/${browser}.zip -d "/ms-playwright/$(basename $(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs))" && \
310+
if [ $? -ne 0 ]; then echo "Failed to extract ${browser}"; exit 1; fi && \
307311
chmod -R +x "/ms-playwright/$(basename $(grep "Install location:" /tmp/${browser}-info.txt | cut -d':' -f2- | xargs))" && \
308312
rm /tmp/${browser}.zip`
309313
);

0 commit comments

Comments
 (0)