Skip to content

Commit 67b803d

Browse files
committed
Make script compatible with yarn berry
1 parent 6ec8e3d commit 67b803d

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

packages/element-web-playwright-common/playwright-screenshots.sh

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,13 @@ IMAGE_NAME="element-web-playwright-common"
1111
build_image() {
1212
echo "Building $IMAGE_NAME image in $SCRIPT_DIR"
1313

14-
# Build image
15-
PW_VERSION=$(
16-
yarn list \
17-
--pattern @playwright/test \
18-
--depth=0 \
19-
--json \
20-
--non-interactive \
21-
--no-progress | \
22-
jq -r '.data.trees[].name | split("@")[2]' \
23-
)
14+
# Fetch the playwright version
15+
# .data.version is for yarn classic
16+
# .children.Version is for yarn berry
17+
PW_VERSION=$(yarn info --manifest --json @playwright/test | jq -r '.data.version // .children.Version')
2418
echo "with Playwright version $PW_VERSION"
2519

20+
# Build image
2621
docker build -t "$IMAGE_NAME" --build-arg "PLAYWRIGHT_VERSION=$PW_VERSION" "$SCRIPT_DIR"
2722
}
2823

0 commit comments

Comments
 (0)