From aca3384d964b6914908e3bf469ae70c14659ced9 Mon Sep 17 00:00:00 2001 From: Fredrik Lassen Date: Tue, 31 Mar 2026 09:34:57 +0200 Subject: [PATCH 1/3] #47 - adjust install script to be respectful of existing installs --- commands/host/1x-playwright-install | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/commands/host/1x-playwright-install b/commands/host/1x-playwright-install index 54abaa6..aae618a 100755 --- a/commands/host/1x-playwright-install +++ b/commands/host/1x-playwright-install @@ -23,17 +23,25 @@ echo -e "${GREEN}Installing playwright (within DDEV):${NC}" ddev add-on get lullabot/ddev-playwright --version 0.5.0 ddev restart -[ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync -# Make sure we have a test/playwright-folder. -ddev exec -d /var/www/html/ "mkdir -p test/playwright" -# Empty JSON so the `ddev install-playwright` actually installs. -[ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync -ddev exec -d /var/www/html/test/playwright 'echo "{}" > ./package.json' +# Only create an empty package.json if it doesn't exist. +if [ ! -f test/playwright/package.json ]; then + [ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync + # Make sure we have a test/playwright-folder. + ddev exec -d /var/www/html/ "mkdir -p test/playwright" + # Empty JSON so the `ddev install-playwright` actually installs. + [ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync + ddev exec -d /var/www/html/test/playwright 'echo "{}" > ./package.json' +fi [ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync # Install playwright *inside* the ddev container (see lullabot/ddev-playwright) ddev install-playwright [ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync -# Use our forked starterkit https://github.com/1xINTERNET/create-dxp-playwright to scaffold. -ddev exec -d /var/www/html/test/playwright "npx --yes 1xINTERNET/create-dxp-playwright --version='~1.58' --quiet" + +if [ ! -f test/playwright/package-lock.json ]; then + # Use our forked starterkit https://github.com/1xINTERNET/create-dxp-playwright to scaffold. + ddev exec -d /var/www/html/test/playwright "npx --yes 1xINTERNET/create-dxp-playwright --version='~1.58' --quiet" +else + echo "Notice: because of an existing test/playwright/package-lock.js, we have NOT (re-)installed 1xINTERNET/create-dxp-playwright!" +fi From 0778c0070c76669e02ac24ca47f4956c2e9efacc Mon Sep 17 00:00:00 2001 From: Fredrik Lassen Date: Tue, 31 Mar 2026 10:10:59 +0200 Subject: [PATCH 2/3] #47 - use DDEV_APPROOT to ensure that we check from project root --- commands/host/1x-playwright-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/host/1x-playwright-install b/commands/host/1x-playwright-install index aae618a..de70794 100755 --- a/commands/host/1x-playwright-install +++ b/commands/host/1x-playwright-install @@ -24,7 +24,7 @@ ddev add-on get lullabot/ddev-playwright --version 0.5.0 ddev restart # Only create an empty package.json if it doesn't exist. -if [ ! -f test/playwright/package.json ]; then +if [ ! -f $DDEV_APPROOT/test/playwright/package.json ]; then [ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync # Make sure we have a test/playwright-folder. ddev exec -d /var/www/html/ "mkdir -p test/playwright" @@ -39,7 +39,7 @@ ddev install-playwright [ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync -if [ ! -f test/playwright/package-lock.json ]; then +if [ ! -f $DDEV_APPROOT/test/playwright/package-lock.json ]; then # Use our forked starterkit https://github.com/1xINTERNET/create-dxp-playwright to scaffold. ddev exec -d /var/www/html/test/playwright "npx --yes 1xINTERNET/create-dxp-playwright --version='~1.58' --quiet" else From 1db93030352adc40ba6bab88a843cf911c6dbd3d Mon Sep 17 00:00:00 2001 From: Samuel Reina Date: Tue, 31 Mar 2026 10:13:08 +0200 Subject: [PATCH 3/3] #47 - Add missing double quotes --- commands/host/1x-playwright-install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/host/1x-playwright-install b/commands/host/1x-playwright-install index de70794..57a6888 100755 --- a/commands/host/1x-playwright-install +++ b/commands/host/1x-playwright-install @@ -24,7 +24,7 @@ ddev add-on get lullabot/ddev-playwright --version 0.5.0 ddev restart # Only create an empty package.json if it doesn't exist. -if [ ! -f $DDEV_APPROOT/test/playwright/package.json ]; then +if [ ! -f "$DDEV_APPROOT/test/playwright/package.json" ]; then [ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync # Make sure we have a test/playwright-folder. ddev exec -d /var/www/html/ "mkdir -p test/playwright" @@ -39,7 +39,7 @@ ddev install-playwright [ "${DDEV_MUTAGEN_ENABLED:-}" = "true" ] && ddev mutagen sync -if [ ! -f $DDEV_APPROOT/test/playwright/package-lock.json ]; then +if [ ! -f "$DDEV_APPROOT/test/playwright/package-lock.json" ]; then # Use our forked starterkit https://github.com/1xINTERNET/create-dxp-playwright to scaffold. ddev exec -d /var/www/html/test/playwright "npx --yes 1xINTERNET/create-dxp-playwright --version='~1.58' --quiet" else