PatchCollector: exit with return code on db failure

This commit is contained in:
Steffen Lange 2022-04-30 15:49:16 +02:00
parent 381c2a5664
commit 83d5ac8517

View file

@ -18,7 +18,10 @@ foreach (new \DirectoryIterator(__DIR__ . '/modules') as $file) {
$db = new Database(__DIR__ . '/db.json');
echo 'Time: ' . date('c', $db->time()) . PHP_EOL;
if ($db->load()) {
if (!$db->load()) {
exit(1);
}
foreach ($list as $patch) {
$oldVer = $db->find($patch->id())->getVersion();
if ($patch->check()) {
@ -36,6 +39,5 @@ if ($db->load()) {
fwrite(STDERR, $patch->id() . ': ' . "\033[31m" . 'CHECK FAILED' . "\033[39m" . '!' . PHP_EOL);
}
$db->save();
}
?>