Skip to content

Commit b581409

Browse files
Copilotswissspidy
andcommitted
Restore original order: generate README before package installation
Reverted to the original order where README generation happens BEFORE package installation. This avoids issues with Composer's autoloader being modified by package installation and then causing problems when spawning new processes. The flow is now: 1. Scaffold tests 2. Generate README (using wp-cli.yml to load commands) 3. Scaffold GitHub files 4. Install package (if not skipped) This way README generation works with launch=false and --path flag, and doesn't conflict with package installation. Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
1 parent 8059488 commit b581409

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/ScaffoldPackageCommand.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,17 @@ public function package( $args, $assoc_args ) {
150150
WP_CLI::runcommand( "scaffold package-tests {$package_dir} {$force_flag}", array( 'launch' => false ) );
151151
}
152152

153+
if ( ! Utils\get_flag_value( $assoc_args, 'skip-readme' ) ) {
154+
WP_CLI::runcommand( "scaffold package-readme {$package_dir} {$force_flag}", array( 'launch' => false ) );
155+
}
156+
153157
if ( ! Utils\get_flag_value( $assoc_args, 'skip-github' ) ) {
154158
WP_CLI::runcommand( "scaffold package-github {$package_dir} {$force_flag}", array( 'launch' => false ) );
155159
}
156160

157161
if ( ! Utils\get_flag_value( $assoc_args, 'skip-install' ) ) {
158162
Process::create( "composer install --working-dir {$package_dir}" )->run();
159163
WP_CLI::runcommand( "package install {$package_dir}", array( 'launch' => false ) );
160-
161-
if ( ! Utils\get_flag_value( $assoc_args, 'skip-readme' ) ) {
162-
WP_CLI::runcommand( "scaffold package-readme {$package_dir} {$force_flag}", array( 'launch' => true ) );
163-
}
164164
}
165165

166166
// Display next steps guidance for users.

0 commit comments

Comments
 (0)