Skip to content

Commit 8a81a05

Browse files
authored
Merge branch 'main' into 165-show-boolean-literal
2 parents 059fbe4 + 7e17246 commit 8a81a05

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

.github/workflows/copilot-setup-steps.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ jobs:
2121

2222
- name: Check existence of composer.json file
2323
id: check_composer_file
24-
uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # v3
25-
with:
26-
files: "composer.json"
24+
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
2725

2826
- name: Set up PHP environment
2927
if: steps.check_composer_file.outputs.files_exists == 'true'
@@ -38,7 +36,7 @@ jobs:
3836

3937
- name: Install Composer dependencies & cache dependencies
4038
if: steps.check_composer_file.outputs.files_exists == 'true'
41-
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3
39+
uses: ramsey/composer-install@a35c6ebd3d08125aaf8852dff361e686a1a67947 # v3
4240
env:
4341
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
4442
with:

features/config-create.feature

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,21 @@ Feature: Create a wp-config file
275275
my\\password
276276
"""
277277
278+
Scenario: wp-config.php in parent folder should not prevent config create in subfolder
279+
Given an empty directory
280+
And a wp-config.php file:
281+
"""
282+
<?php
283+
echo "some broken or custom wp-config.php file";
284+
"""
285+
286+
When I run `wp core download --path=subdir`
287+
Then the return code should be 0
288+
289+
When I run `wp config create --skip-check --dbname=somedb --dbuser=someuser --dbpass=somepassword --path=subdir`
290+
Then the return code should be 0
291+
And the subdir/wp-config.php file should exist
292+
278293
@require-mysql @require-mysql-5.7
279294
Scenario: Configure with required SSL connection
280295
Given an empty directory

src/Config_Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function create( $_, $assoc_args ) {
202202
if ( ! Utils\get_flag_value( $assoc_args, 'force' ) ) {
203203
if ( isset( $assoc_args['config-file'] ) && file_exists( $assoc_args['config-file'] ) ) {
204204
$this->config_file_already_exist_error( basename( $assoc_args['config-file'] ) );
205-
} elseif ( ! isset( $assoc_args['config-file'] ) && Utils\locate_wp_config() ) {
205+
} elseif ( ! isset( $assoc_args['config-file'] ) && file_exists( rtrim( ABSPATH, '/\\' ) . '/wp-config.php' ) ) {
206206
$this->config_file_already_exist_error( 'wp-config.php' );
207207
}
208208
}

0 commit comments

Comments
 (0)