Skip to content

Commit 1644558

Browse files
authored
Check more files to determine if WordPress is present or not (#233)
* fix: Add user confirmation for re-download the WordPress 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. * Feat: Add some file checks before redownloading the WordPress
1 parent e5b4c5b commit 1644558

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Core_Command.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ public function download( $args, $assoc_args ) {
137137
? ( rtrim( $assoc_args['path'], '/\\' ) . '/' )
138138
: ABSPATH;
139139

140-
$wordpress_present = is_readable( $download_dir . 'wp-load.php' );
140+
// Check for files if WordPress already present or not.
141+
$wordpress_present = is_readable( $download_dir . 'wp-load.php' )
142+
|| is_readable( $download_dir . 'wp-mail.php' )
143+
|| is_readable( $download_dir . 'wp-cron.php' )
144+
|| is_readable( $download_dir . 'wp-links-opml.php' );
141145

142146
if ( $wordpress_present && ! Utils\get_flag_value( $assoc_args, 'force' ) ) {
143147
WP_CLI::error( 'WordPress files seem to already be present here.' );

0 commit comments

Comments
 (0)