diff --git a/src/Commands/DeploymentsLogs.php b/src/Commands/DeploymentsLogs.php index 3d8d1eb..40399c1 100644 --- a/src/Commands/DeploymentsLogs.php +++ b/src/Commands/DeploymentsLogs.php @@ -52,11 +52,12 @@ protected function show(InputInterface $input, OutputInterface $output): int foreach ($logs as $log) { $output->writeln($log['line'], OutputInterface::OUTPUT_RAW); } - $summary = "Deployment #$id: {$deployment['message']}"; + $stderr = $this->stderr($output); + $stderr->writeln("Deployment #$id: {$deployment['message']}", OutputInterface::OUTPUT_RAW); + // On its own lines, as `bref deploy` shows it: it can span several lines, and ends with a hint for known errors if ($deployment['error_message']) { - $summary .= " ({$deployment['error_message']})"; + $stderr->writeln(['', $deployment['error_message']], OutputInterface::OUTPUT_RAW); } - $this->stderr($output)->writeln($summary, OutputInterface::OUTPUT_RAW); return 0; } diff --git a/tests/Commands/DeploymentsLogsTest.php b/tests/Commands/DeploymentsLogsTest.php index 738789e..b9d9e3f 100644 --- a/tests/Commands/DeploymentsLogsTest.php +++ b/tests/Commands/DeploymentsLogsTest.php @@ -51,6 +51,6 @@ public function test_agents_get_the_logs_as_text_without_colors(): void $this->assertSame(0, $tester->getStatusCode(), $tester->getDisplay()); $this->assertSame("✔ Packaged\nUPDATE_FAILED AWS::Lambda::Function\n", $tester->getDisplay()); - $this->assertSame("Deployment #25: failed (The CloudFormation stack failed to update)\n", $tester->getErrorOutput()); + $this->assertSame("Deployment #25: failed\n\nThe CloudFormation stack failed to update\n", $tester->getErrorOutput()); } }