Skip to content

Check more files to determine if WordPress is present or not#233

Merged
danielbachhuber merged 2 commits intowp-cli:mainfrom
hbhalodia:fix/patch-164
May 24, 2023
Merged

Check more files to determine if WordPress is present or not#233
danielbachhuber merged 2 commits intowp-cli:mainfrom
hbhalodia:fix/patch-164

Conversation

@hbhalodia
Copy link
Contributor

@hbhalodia hbhalodia commented May 24, 2023

Issue

Description

  • If a user has an empty directory and then adds the empty wp-load.php file and runs wp core download, it would throw an error saying WordPress files seem to already be present here. This is only dependent point for this command to identify the WordPress files are present or not.

Solution

Test

  • Have run the behat test and all tests pass successfully, I did not exactly know if we required to add the test's because there is already a general test written for this kind of scenario,
    Scenario: Don't download WordPress when files are already present
    Given an empty directory
    And WP files
    When I try `wp core download`
    Then STDERR should be:
    """
    Error: WordPress files seem to already be present here.
    """
    And the return code should be 1

Cc: @danielbachhuber

hbhalodia added 2 commits May 23, 2023 14:40
Added the user confirmation prompt while re-downloading the WordPress core files when user have alerady downloaded. Also added the modified version to check multiple WordPress files so that it does not have dependency on `wp-load.php` file.
@hbhalodia hbhalodia requested a review from a team as a code owner May 24, 2023 05:07
@danielbachhuber danielbachhuber added command:core-download Related to 'core download' command command:core Related to 'core' command labels May 24, 2023
@danielbachhuber danielbachhuber added this to the 2.1.12 milestone May 24, 2023
@danielbachhuber danielbachhuber changed the title Feat: Add file checks while user attempts to re download the WordPress Check more files to determine if WordPress is present or not May 24, 2023
@danielbachhuber
Copy link
Member

Have run the behat test and all tests pass successfully, I did not exactly know if we required to add the test's because there is already a general test written for this kind of scenario,

Makes sense, this seems fine.

@danielbachhuber danielbachhuber merged commit 1644558 into wp-cli:main May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:core Related to 'core' command command:core-download Related to 'core download' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wp core download unable to find if wordpress installation already exists in case of missing wp-load.php

2 participants