From 4d74fe35dcc5358f655904439674a92f1f8c72d5 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Mon, 21 Apr 2025 22:38:10 +0100 Subject: [PATCH] Update WordPress Playground integration to use npx --- bin/setup-test-env.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) mode change 100644 => 100755 bin/setup-test-env.sh diff --git a/bin/setup-test-env.sh b/bin/setup-test-env.sh old mode 100644 new mode 100755 index 5d98dbf..019e98b --- a/bin/setup-test-env.sh +++ b/bin/setup-test-env.sh @@ -26,9 +26,10 @@ install_wp_env() { # Function to install wp-playground if needed install_wp_playground() { - if ! command_exists wp-playground; then - echo "wp-playground is not installed. Installing..." - npm install -g @wordpress/playground-tools + # Check if we have a local installation + if [ ! -d "node_modules/@wp-playground" ]; then + echo "WordPress Playground is not installed locally. Installing..." + npm install --save-dev @wp-playground/client @wp-playground/blueprints fi } @@ -149,7 +150,7 @@ EOF # Start WordPress Playground echo "Starting WordPress Playground..." - wp-playground start --blueprint playground/blueprint.json --port 8888 & + npx @wp-playground/client start --blueprint playground/blueprint.json --port 8888 & # Wait for WordPress Playground to be ready echo "Waiting for WordPress Playground to be ready..." @@ -242,7 +243,7 @@ EOF # Start WordPress Playground echo "Starting WordPress Playground..." - wp-playground start --blueprint playground/multisite-blueprint.json --port 8888 & + npx @wp-playground/client start --blueprint playground/multisite-blueprint.json --port 8888 & # Wait for WordPress Playground to be ready echo "Waiting for WordPress Playground to be ready..."