Skip to content

Commit f7d8cef

Browse files
Copilotswissspidy
andcommitted
Use launch=true to load wp-cli.yml when scaffolding README
Changed package-readme call to use launch=true instead of launch=false. This spawns a new WP-CLI process that automatically loads the wp-cli.yml file from the package directory, which in turn loads the command file. This is cleaner than hardcoding the command filename. Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 38026ac commit f7d8cef

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/ScaffoldPackageCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ public function package( $args, $assoc_args ) {
139139
}
140140

141141
if ( ! Utils\get_flag_value( $assoc_args, 'skip-readme' ) ) {
142-
// Load the command before generating the README so it can be documented
143-
$command_file = "{$package_dir}/hello-world-command.php";
144-
WP_CLI::runcommand( "scaffold package-readme {$package_dir} {$force_flag} --require={$command_file}", array( 'launch' => false ) );
142+
WP_CLI::runcommand( "scaffold package-readme {$package_dir} {$force_flag}", array( 'launch' => true ) );
145143
}
146144

147145
if ( ! Utils\get_flag_value( $assoc_args, 'skip-github' ) ) {

0 commit comments

Comments
 (0)