Skip to content

Commit 0e4ddbb

Browse files
committed
Simplify path to wp-config.php and ensure writable for E2E tests
1 parent 8f2af97 commit 0e4ddbb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/local-env/scripts/install.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,18 @@ 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');
910

1011
dotenvExpand.expand( dotenv.config() );
1112

1213
// Determine if a non-default database authentication plugin needs to be used.
1314
local_env_utils.determine_auth_option();
1415

1516
// Create wp-config.php.
16-
wp_cli( `config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --force --config-file=${process.env.LOCAL_DIR}/../wp-config.php` );
17+
wp_cli( `config create --dbname=wordpress_develop --dbuser=root --dbpass=password --dbhost=mysql --force --config-file="wp-config.php"` );
18+
19+
// Make sure wp-config.php is writable for the sake of E2E tests.
20+
fs.chmodSync( 'wp-config.php', 0o666 );
1721

1822
// Add the debug settings to wp-config.php.
1923
// 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)