Skip to content

Commit

Permalink
tech(generate_env_docker): mv jq to cut (#7038)
Browse files Browse the repository at this point in the history
Утилита jq не является базовой утилитой, поэтому заменил на cut.
  • Loading branch information
inomdzhon authored Jun 20, 2024
1 parent 4e8fa2e commit feece10
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/vkui/scripts/generate_env_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
rm -f .env.docker
touch .env.docker

PLAYWRIGHT_VERSION=$(yarn info @playwright/test --all --json | jq -r '.children' | jq -r '.Version');
# Выдаёт версию зависимости в виде строки вида: '└─ @playwright/test@npm:1.44.1'
YARN_INFO_OUTPUT=$(yarn info @playwright/test --all --name-only);

# Делит строку по разделителю и берёт правую часть.
#
# В JavaScript это выглядило бы так:
#
# ```js
# const PLAYWRIGHT_VERSION = '└─ @playwright/test@npm:1.44.1'.split(':')[1];
# ```
PLAYWRIGHT_VERSION=$(echo $YARN_INFO_OUTPUT | cut -f 2 -d :);

# см. https://github.com/microsoft/playwright/blob/main/utils/docker/Dockerfile.focal
echo "IMAGE=mcr.microsoft.com/playwright:v${PLAYWRIGHT_VERSION}-focal" >> .env.docker;
Expand Down

0 comments on commit feece10

Please sign in to comment.