Skip to content

Commit ef8e06f

Browse files
Copilotswissspidy
andcommitted
Fix dry-run output to show message for table/summary formats and fix theme test
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 1e612fb commit ef8e06f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

features/language-theme.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ Feature: Manage theme translation files for a WordPress install
334334
Given a WP install
335335

336336
When I try `wp theme install twentyten`
337-
Then STDERR should be empty
337+
Then STDOUT should not be empty
338338

339339
When I run `wp language theme update twentyten --format=json`
340340
Then STDOUT should be:

src/WP_CLI/CommandWithTranslation.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,11 @@ public function update( $args, $assoc_args ) {
150150
if ( Utils\get_flag_value( $assoc_args, 'dry-run' ) ) {
151151
$update_count = count( $updates );
152152

153-
if ( $format ) {
153+
if ( $format && ! in_array( $format, array( 'table', 'summary' ), true ) ) {
154+
// For json/csv formats, just output the formatted data without the message
154155
Utils\format_items( $format, $updates, array( 'Type', 'Name', 'Version', 'Language' ) );
155156
} else {
157+
// For table/summary/no format, show the message and table
156158
WP_CLI::line(
157159
sprintf(
158160
'Found %d translation %s that would be processed:',

0 commit comments

Comments
 (0)