Skip to content

Commit 7e8967a

Browse files
committed
Avoid exploding on conflict of controllers.json
1 parent 6592349 commit 7e8967a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/PackageJsonSynchronizer.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,12 @@ private function updateControllersJsonFile(array $phpPackages)
296296
return;
297297
}
298298

299-
$previousControllersJson = (new JsonFile($controllersJsonPath))->read();
299+
try {
300+
$previousControllersJson = (new JsonFile($controllersJsonPath))->read();
301+
} catch (ParsingException $e) {
302+
// if controllers.json is invalid (possible during a recipe upgrade), we can't update the file
303+
return;
304+
}
300305
$newControllersJson = [
301306
'controllers' => [],
302307
'entrypoints' => $previousControllersJson['entrypoints'],

0 commit comments

Comments
 (0)