Update WordPress Playground integration to use npx
This commit is contained in:
11
bin/setup-test-env.sh
Normal file → Executable file
11
bin/setup-test-env.sh
Normal file → Executable file
@@ -26,9 +26,10 @@ install_wp_env() {
|
|||||||
|
|
||||||
# Function to install wp-playground if needed
|
# Function to install wp-playground if needed
|
||||||
install_wp_playground() {
|
install_wp_playground() {
|
||||||
if ! command_exists wp-playground; then
|
# Check if we have a local installation
|
||||||
echo "wp-playground is not installed. Installing..."
|
if [ ! -d "node_modules/@wp-playground" ]; then
|
||||||
npm install -g @wordpress/playground-tools
|
echo "WordPress Playground is not installed locally. Installing..."
|
||||||
|
npm install --save-dev @wp-playground/client @wp-playground/blueprints
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,7 +150,7 @@ EOF
|
|||||||
|
|
||||||
# Start WordPress Playground
|
# Start WordPress Playground
|
||||||
echo "Starting 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
|
# Wait for WordPress Playground to be ready
|
||||||
echo "Waiting for WordPress Playground to be ready..."
|
echo "Waiting for WordPress Playground to be ready..."
|
||||||
@@ -242,7 +243,7 @@ EOF
|
|||||||
|
|
||||||
# Start WordPress Playground
|
# Start WordPress Playground
|
||||||
echo "Starting 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
|
# Wait for WordPress Playground to be ready
|
||||||
echo "Waiting for WordPress Playground to be ready..."
|
echo "Waiting for WordPress Playground to be ready..."
|
||||||
|
|||||||
Reference in New Issue
Block a user