PatchCollector: exit with return code on db failure
This commit is contained in:
parent
381c2a5664
commit
83d5ac8517
1 changed files with 20 additions and 18 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue