Skip to content

Commit c886e71

Browse files
Copilotswissspidy
andcommitted
Improve error message to include specific missing command
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 8bb7125 commit c886e71

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

features/scaffold-package-readme.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ Feature: Scaffold a README.md file for an existing package
313313
When I try `wp scaffold package-readme foo`
314314
Then STDERR should be:
315315
"""
316-
Error: Missing one or more commands defined in composer.json -> extra -> commands.
316+
Error: Command 'profile' is not registered. Make sure it is loaded before running package-readme.
317317
"""
318318
And the return code should be 1
319319

src/ScaffoldPackageCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ public function package_readme( $args, $assoc_args ) {
333333
} while ( $parent_command && $bits );
334334

335335
if ( empty( $parent_command ) ) {
336-
WP_CLI::error( 'Missing one or more commands defined in composer.json -> extra -> commands.' );
336+
WP_CLI::error( "Command '{$command}' is not registered. Make sure it is loaded before running package-readme." );
337337
}
338338

339339
$longdesc = isset( $parent_command['longdesc'] ) ? $parent_command['longdesc'] : '';

0 commit comments

Comments
 (0)