Skip to content

Commit 12b4457

Browse files
committed
Make wp-config.php writable from inside container
1 parent 0e4ddbb commit 12b4457

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tools/local-env/scripts/install.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const wait_on = require( 'wait-on' );
66
const { execSync } = require( 'child_process' );
77
const { readFileSync, writeFileSync } = require( 'fs' );
88
const local_env_utils = require( './utils' );
9-
const fs = require('fs');
109

1110
dotenvExpand.expand( dotenv.config() );
1211

@@ -16,8 +15,8 @@ local_env_utils.determine_auth_option();
1615
// Create wp-config.php.
1716
wp_cli( `config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --force --config-file="wp-config.php"` );
1817

19-
// Make sure wp-config.php is writable for the sake of E2E tests.
20-
fs.chmodSync( 'wp-config.php', 0o666 );
18+
// 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.
19+
execSync( 'node ./tools/local-env/scripts/docker.js exec cli chmod 666 wp-config.php' );
2120

2221
// Add the debug settings to wp-config.php.
2322
// Windows requires this to be done as an additional step, rather than using the --extra-php option in the previous step.

0 commit comments

Comments
 (0)