Skip to content

Commit

Permalink
Merge pull request mautic#12203 from beetofly/feat-exit-codes-mautic5
Browse files Browse the repository at this point in the history
Add exit code to some mautic commands for mautic 5
  • Loading branch information
escopecz authored Apr 13, 2023
2 parents 3f6adc1 + eb327e6 commit 6f66522
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,16 +217,18 @@ protected function execute(InputInterface $input, OutputInterface $output): int

// Specific campaign;
if ($id) {
$statusCode = 0;
/** @var \Mautic\CampaignBundle\Entity\Campaign $campaign */
if ($campaign = $this->campaignRepository->getEntity($id)) {
$this->triggerCampaign($campaign);
} else {
$output->writeln('<error>'.$this->translator->trans('mautic.campaign.rebuild.not_found', ['%id%' => $id]).'</error>');
$statusCode = 1;
}

$this->completeRun();

return 0;
return (int) $statusCode;
}

// All published campaigns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (null === $campaign) {
$output->writeln('<error>'.$this->translator->trans('mautic.campaign.rebuild.not_found', ['%id%' => $id]).'</error>');

return 0;
return 1;
}

$this->updateCampaign($campaign);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
if (!count($webhooks)) {
$output->writeln('<error>No published webhooks found. Try again later.</error>');

return 0;
return 1;
}

$output->writeLn('<info>Processing Webhooks</info>');
Expand Down

0 comments on commit 6f66522

Please sign in to comment.