Skip to content

Commit

Permalink
Merge pull request #124 from exonet/mku/debug-output
Browse files Browse the repository at this point in the history
Add some debugging output when passing -v
  • Loading branch information
robbinjanssen authored Mar 3, 2025
2 parents e8d6c9a + b5aab7f commit 2eaf2d7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/Commands/MergeLatestTagCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
]
);

if ($input->getOption('verbose')) {
$output->writeln('Response:');
$output->writeLn(' Status: '.$response->getStatusCode());
$output->writeLn(' Body: '.$response->getBody()->getContents());
$output->writeLn('');
}

$release = json_decode($response->getBody(), true);

return $this->call($input, $output, [
Expand Down
9 changes: 7 additions & 2 deletions src/Commands/PrMergeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function call(InputInterface $input, OutputInterface $output, array $s

// Construct and execute the request.
$client = new Client();
$client->post(
$response = $client->post(
$_ENV['DESTINATION_URL'],
[
'body' => $payload,
Expand All @@ -112,7 +112,12 @@ protected function call(InputInterface $input, OutputInterface $output, array $s
],
]
);

if ($input->getOption('verbose')) {
$output->writeln('Response:');
$output->writeLn(' Status: '.$response->getStatusCode());
$output->writeLn(' Body: '.$response->getBody()->getContents());
$output->writeLn('');
}
$output->writeLn('Done.');

return 0;
Expand Down
9 changes: 8 additions & 1 deletion src/Commands/PublishReleaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

// Construct and execute the request.
$client = new Client();
$client->post(
$response = $client->post(
$_ENV['DESTINATION_URL'],
[
'body' => $payload,
Expand All @@ -93,6 +93,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
]
);

if ($input->getOption('verbose')) {
$output->writeln('Response:');
$output->writeLn(' Status: '.$response->getStatusCode());
$output->writeLn(' Body: '.$response->getBody()->getContents());
$output->writeLn('');
}

$output->writeLn('Done.');

return 0;
Expand Down

0 comments on commit 2eaf2d7

Please sign in to comment.