File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,34 @@ IMAGE_TAG="v1.40.0-jammy" # This version have to be synchronized with playwright
77
88NODE_MODULES_CACHE_DIR=" $HOME /.cache/dynamic-forms-playwright-docker-node-modules"
99
10+ command_exists () {
11+ command -v " $1 " > /dev/null 2>&1
12+ }
13+
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