[cli] don't exit until after we have committed or rolled back the db
This commit is contained in:
parent
83f3ae99eb
commit
7f20b17a59
2 changed files with 4 additions and 1 deletions
|
@ -12,6 +12,7 @@ class CliApp extends \Symfony\Component\Console\Application
|
|||
public function __construct()
|
||||
{
|
||||
parent::__construct('Shimmie', VERSION);
|
||||
$this->setAutoExit(false);
|
||||
}
|
||||
|
||||
protected function getDefaultInputDefinition(): InputDefinition
|
||||
|
|
|
@ -84,7 +84,9 @@ try {
|
|||
ob_implicit_flush(true);
|
||||
$app = new CliApp();
|
||||
send_event(new CliGenEvent($app));
|
||||
$app->run();
|
||||
if($app->run() !== 0) {
|
||||
throw new \Exception("CLI command failed");
|
||||
}
|
||||
} else {
|
||||
send_event(new PageRequestEvent($_SERVER['REQUEST_METHOD'], _get_query()));
|
||||
$page->display();
|
||||
|
|
Reference in a new issue