diff --git a/src/Command/Api/ApiBaseCommand.php b/src/Command/Api/ApiBaseCommand.php index 8439bf39a..2af1251a0 100644 --- a/src/Command/Api/ApiBaseCommand.php +++ b/src/Command/Api/ApiBaseCommand.php @@ -94,6 +94,10 @@ protected function interact(InputInterface $input, OutputInterface $output): voi parent::interact($input, $output); } + /** + * @throws \Acquia\Cli\Exception\AcquiaCliException + * @throws \JsonException + */ protected function execute(InputInterface $input, OutputInterface $output): int { if ($this->getName() === 'api:base') { @@ -124,10 +128,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int $exitCode = 1; } - $contents = json_encode($response, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT); - $this->output->writeln($contents); - if ($exitCode || !$this->getParamFromInput($input, 'task-wait')) { + $contents = json_encode($response, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT); + $this->output->writeln($contents); return $exitCode; } $notificationUuid = CommandBase::getNotificationUuidFromResponse($response);