Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
May 24, 2023

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

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 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 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
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment