Skip to content

Commit

Permalink
CliRunner: fixed exit code != 0 on error [Closes #148]
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Aug 27, 2021
1 parent 51a3533 commit 49e23b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Deployment/CliRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public function run(): ?int
$time = time();
$this->logger->log('Started at ' . date('[Y/m/d H:i]'));
$this->logger->log("Config file is $this->configFile");
$res = 0;

foreach ($this->batches as $name => $batch) {
$this->logger->log("\nDeploying $name");
Expand Down Expand Up @@ -98,13 +99,14 @@ public function run(): ?int
$deployment->deploy();
} catch (JobException | ServerException $e) {
$this->logger->log("Error: {$e->getMessage()} in {$e->getFile()}:{$e->getLine()}\n\n$e", 'red');
$res = 1;
}
$this->logger->log("\n\n");
}

$time = time() - $time;
$this->logger->log('Finished at ' . date('[Y/m/d H:i]') . " (in $time seconds)\n----------------------------------------------\n\n", 'lime');
return 0;
return $res;
}


Expand Down

0 comments on commit 49e23b2

Please sign in to comment.