Fail the repair command when an error happened

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2023-02-20 14:33:06 +01:00
parent fc27faab3f
commit 438e860f0a
No known key found for this signature in database
GPG key ID: 74434EFE0D2E2205

View file

@ -52,6 +52,8 @@ class Repair extends Command {
private $output;
/** @var IAppManager */
private $appManager;
/** @var bool */
protected $errored = false;
/**
* @param \OC\Repair $repair
@ -109,6 +111,8 @@ class Repair extends Command {
}
}
$maintenanceMode = $this->config->getSystemValueBool('maintenance');
$this->config->setSystemValue('maintenance', true);
@ -125,7 +129,7 @@ class Repair extends Command {
$this->repair->run();
$this->config->setSystemValue('maintenance', $maintenanceMode);
return 0;
return $this->errored ? 1 : 0;
}
public function handleRepairFeedBack($event) {
@ -154,6 +158,7 @@ class Repair extends Command {
break;
case '\OC\Repair::error':
$this->output->writeln('<error> - ERROR: ' . $event->getArgument(0) . '</error>');
$this->errored = true;
break;
}
}