Skip to content

Commit

Permalink
fix: PackageUpdater failure (#3078)
Browse files Browse the repository at this point in the history
* fix: PackageUpdater failure

* exit 1 on failure
  • Loading branch information
PROFeNoM authored Feb 10, 2025
1 parent 2be065b commit b8e8454
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/PackageUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private function processFile(string $file): void

$this->updatePackageVersion($library, $composer);
} catch (Throwable $e) {
$this->errors[] = "Error processing $file: " . $e->getMessage();
$this->errors[] = "Error processing $file: " . $e->getMessage() . PHP_EOL . $e->getTraceAsString();
}
}

Expand All @@ -91,7 +91,9 @@ private function findComposerFile(string $className, string $file): ?string
{
foreach (['getAppIndexScript', 'getConsoleScript'] as $method) {
if (method_exists($className, $method)) {
$dir = dirname(call_user_func([$className, $method]));
$scriptPath = call_user_func([$className, $method]);
if (!$scriptPath) continue;
$dir = dirname($scriptPath);
while (basename($dir) !== 'Frameworks') {
$possible = "$dir/composer.json";
if (file_exists($possible)) {
Expand Down Expand Up @@ -178,6 +180,7 @@ private function displaySummary(): void
foreach ($this->errors as $error) {
echo "- $error\n";
}
exit(1);
}
}
}
Expand Down

0 comments on commit b8e8454

Please sign in to comment.