Skip to content

Commit

Permalink
Improve Composer error handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz committed Dec 9, 2024
1 parent 7d57479 commit a76c47b
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -884,11 +884,13 @@ protected function buildModule(string $module, OutputInterface $output): bool|st
return "Cannot write to $localComposer.";
}

// Run Composer to update autoloader:
// Try to automatically run Composer to update autoloader; output warning if it fails:
chdir($this->baseDir);
if (false === exec('composer install', result_code: $composerResult) || $composerResult !== 0) {
return "Problem running composer to update autoload rules for module $module.\n"
. 'Please make sure the composer command is on your search path.';
$output->writeLn(
"<error>WARNING: Could not run composer to update autoload rules for module $module.\n"
. 'Please run "composer install" to ensure correct custom module loading.</error>'
);
}
return true;
}
Expand Down

0 comments on commit a76c47b

Please sign in to comment.