File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -5,22 +5,36 @@ set -euo pipefail
55IMAGE_NAME=" mcr.microsoft.com/playwright"
66IMAGE_TAG=" v1.45.3-jammy" # This version have to be synchronized with playwright version from package.json
77
8- NODE_MODULES_CACHE_DIR=" $HOME /.cache/dynamic-forms-playwright-docker-node-modules"
8+ NODE_MODULES_CACHE_DIR=" $HOME /.cache/page-constructor-playwright-docker-node-modules"
9+
10+ command_exists () {
11+ command -v " $1 " > /dev/null 2>&1
12+ }
913
1014run_command () {
11- docker run --rm --network host -it -w /work \
15+ $CONTAINER_TOOL run --rm --network host -it -w /work \
1216 -v $( pwd) :/work \
1317 -v " $NODE_MODULES_CACHE_DIR :/work/node_modules" \
1418 " $IMAGE_NAME :$IMAGE_TAG " \
1519 /bin/bash -c " $1 "
1620}
1721
22+ if command_exists docker; then
23+ CONTAINER_TOOL=" docker"
24+ elif command_exists podman; then
25+ CONTAINER_TOOL=" podman"
26+ else
27+ echo " Neither Docker nor Podman is installed on the system."
28+ exit 1
29+ fi
30+
1831if [[ " $1 " = " clear-cache" ]]; then
1932 rm -rf " $NODE_MODULES_CACHE_DIR "
2033 exit 0
2134fi
2235
2336if [[ ! -d " $NODE_MODULES_CACHE_DIR " ]]; then
37+ mkdir -p " $NODE_MODULES_CACHE_DIR "
2438 run_command ' npm ci'
2539fi
2640
You can’t perform that action at this time.
0 commit comments