Skip to content

Commit 99cd149

Browse files
Copilotswissspidy
andcommitted
Use launch=true for package-readme to ensure commands are loaded
When scaffold package installs a package and then calls package-readme, the newly installed package needs to be available. Using launch=true spawns a new WP-CLI process where the package installation is fully effective and commands are properly loaded. Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 419fc9c commit 99cd149

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ScaffoldPackageCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ public function package( $args, $assoc_args ) {
145145
if ( ! Utils\get_flag_value( $assoc_args, 'skip-install' ) ) {
146146
Process::create( "composer install --working-dir {$package_dir}" )->run();
147147
WP_CLI::runcommand( "package install {$package_dir}", array( 'launch' => false ) );
148+
}
148149

149-
if ( ! Utils\get_flag_value( $assoc_args, 'skip-readme' ) ) {
150-
WP_CLI::runcommand( "scaffold package-readme {$package_dir} {$force_flag}", array( 'launch' => false ) );
151-
}
150+
if ( ! Utils\get_flag_value( $assoc_args, 'skip-readme' ) ) {
151+
WP_CLI::runcommand( "scaffold package-readme {$package_dir} {$force_flag}", array( 'launch' => true ) );
152152
}
153153
}
154154

0 commit comments

Comments
 (0)