Skip to content

Commit 3ff586a

Browse files
committed
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
1 parent bcdca3f commit 3ff586a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/local-env/scripts/install.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dotenvExpand.expand( dotenv.config() );
1212
local_env_utils.determine_auth_option();
1313

1414
// Create wp-config.php.
15-
wp_cli( 'config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --path=/var/www/src --force' );
15+
wp_cli( 'config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --force' );
1616

1717
// Add the debug settings to wp-config.php.
1818
// 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}
2424
wp_cli( `config set WP_DEVELOPMENT_MODE ${process.env.LOCAL_WP_DEVELOPMENT_MODE} --type=constant` );
2525

2626
// Move wp-config.php to the base directory, so it doesn't get mixed up in the src or build directories.
27-
renameSync( 'src/wp-config.php', 'wp-config.php' );
27+
renameSync( `${process.env.LOCAL_DIR}/wp-config.php`, 'wp-config.php' );
2828

2929
install_wp_importer();
3030

@@ -55,7 +55,7 @@ wait_on( { resources: [ `tcp:localhost:${process.env.LOCAL_PORT}`] } )
5555
function wp_cli( cmd ) {
5656
const composeFiles = local_env_utils.get_compose_files();
5757

58-
execSync( `docker compose ${composeFiles} run --quiet-pull --rm cli ${cmd}`, { stdio: 'inherit' } );
58+
execSync( `docker compose ${composeFiles} run --quiet-pull --rm cli ${cmd} --path=/var/www/${process.env.LOCAL_DIR}`, { stdio: 'inherit' } );
5959
}
6060

6161
/**

0 commit comments

Comments
 (0)