summaryrefslogtreecommitdiffstatshomepage
path: root/tools/local-env/scripts/install.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/local-env/scripts/install.js')
-rw-r--r--tools/local-env/scripts/install.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/local-env/scripts/install.js b/tools/local-env/scripts/install.js
index b9fba5667a..19a0f46e08 100644
--- a/tools/local-env/scripts/install.js
+++ b/tools/local-env/scripts/install.js
@@ -13,7 +13,10 @@ 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 --force --config-file=${process.env.LOCAL_DIR}/../wp-config.php` );
+wp_cli( `config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --force --config-file="wp-config.php"` );
+
+// Since WP-CLI runs as root, the wp-config.php created above will be read-only. This needs to be writable for the sake of E2E tests.
+execSync( 'node ./tools/local-env/scripts/docker.js exec cli chmod 666 wp-config.php' );
// 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.
@@ -61,7 +64,5 @@ wait_on( {
* @param {string} cmd The WP-CLI command to run.
*/
function wp_cli( cmd ) {
- const composeFiles = local_env_utils.get_compose_files();
-
- execSync( `docker compose ${composeFiles} run --quiet-pull --rm cli ${cmd} --path=/var/www/${process.env.LOCAL_DIR}`, { stdio: 'inherit' } );
+ execSync( `npm --silent run env:cli -- ${cmd} --path=/var/www/${process.env.LOCAL_DIR}`, { stdio: 'inherit' } );
}