From 3ff586a4e38681389d51206245750e5b72887cf6 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 3 Feb 2025 13:35:25 +0000 Subject: [PATCH] Build/Test Tools: Fix the source code path handling when installing the local development environment. This ensures the correct code is used to run the installation depending on whether it should be running from the `src` or `build` directory. Props swissspidy, johnbillion See #62221 git-svn-id: https://develop.svn.wordpress.org/trunk@59752 602fd350-edb4-49c9-b593-d223f7449a82 --- tools/local-env/scripts/install.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/local-env/scripts/install.js b/tools/local-env/scripts/install.js index d924ffc30d..f8e6285fb9 100644 --- a/tools/local-env/scripts/install.js +++ b/tools/local-env/scripts/install.js @@ -12,7 +12,7 @@ dotenvExpand.expand( dotenv.config() ); local_env_utils.determine_auth_option(); // Create wp-config.php. -wp_cli( 'config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --path=/var/www/src --force' ); +wp_cli( 'config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --force' ); // Add the debug settings to wp-config.php. // Windows requires this to be done as an additional step, rather than using the --extra-php option in the previous step. @@ -24,7 +24,7 @@ wp_cli( `config set WP_ENVIRONMENT_TYPE ${process.env.LOCAL_WP_ENVIRONMENT_TYPE} wp_cli( `config set WP_DEVELOPMENT_MODE ${process.env.LOCAL_WP_DEVELOPMENT_MODE} --type=constant` ); // Move wp-config.php to the base directory, so it doesn't get mixed up in the src or build directories. -renameSync( 'src/wp-config.php', 'wp-config.php' ); +renameSync( `${process.env.LOCAL_DIR}/wp-config.php`, 'wp-config.php' ); install_wp_importer(); @@ -55,7 +55,7 @@ wait_on( { resources: [ `tcp:localhost:${process.env.LOCAL_PORT}`] } ) function wp_cli( cmd ) { const composeFiles = local_env_utils.get_compose_files(); - execSync( `docker compose ${composeFiles} run --quiet-pull --rm cli ${cmd}`, { stdio: 'inherit' } ); + execSync( `docker compose ${composeFiles} run --quiet-pull --rm cli ${cmd} --path=/var/www/${process.env.LOCAL_DIR}`, { stdio: 'inherit' } ); } /**