Make script compatible with yarn berry
This commit is contained in:
@@ -11,18 +11,13 @@ IMAGE_NAME="element-web-playwright-common"
|
|||||||
build_image() {
|
build_image() {
|
||||||
echo "Building $IMAGE_NAME image in $SCRIPT_DIR"
|
echo "Building $IMAGE_NAME image in $SCRIPT_DIR"
|
||||||
|
|
||||||
# Build image
|
# Fetch the playwright version
|
||||||
PW_VERSION=$(
|
# .data.version is for yarn classic
|
||||||
yarn list \
|
# .children.Version is for yarn berry
|
||||||
--pattern @playwright/test \
|
PW_VERSION=$(yarn info --manifest --json @playwright/test | jq -r '.data.version // .children.Version')
|
||||||
--depth=0 \
|
|
||||||
--json \
|
|
||||||
--non-interactive \
|
|
||||||
--no-progress | \
|
|
||||||
jq -r '.data.trees[].name | split("@")[2]' \
|
|
||||||
)
|
|
||||||
echo "with Playwright version $PW_VERSION"
|
echo "with Playwright version $PW_VERSION"
|
||||||
|
|
||||||
|
# Build image
|
||||||
docker build -t "$IMAGE_NAME" --build-arg "PLAYWRIGHT_VERSION=$PW_VERSION" "$SCRIPT_DIR"
|
docker build -t "$IMAGE_NAME" --build-arg "PLAYWRIGHT_VERSION=$PW_VERSION" "$SCRIPT_DIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user