Skip to content

Commit

Permalink
Merge pull request #238 from mnapoli/fix-bref-cli-exit-code
Browse files Browse the repository at this point in the history
Fix Bref CLI exit code
  • Loading branch information
mnapoli authored Feb 13, 2019
2 parents 59389a0 + a051773 commit a854cdf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bref
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ $app->command('cli function [--region=] [arguments]*', function (string $functio
return 1;
}

if (isset($result->getPayload()['output'])) {
$io->writeln($result->getPayload()['output']);
$payload = $result->getPayload();
if (isset($payload['output'])) {
$io->writeln($payload['output']);
} else {
$io->error('The command did not return a valid response.');
$io->writeln('<info>Logs:</info>');
$io->write('<comment>' . $result->getLogs() . '</comment>');
$io->writeln('<info>Lambda result payload:</info>');
$io->writeln(json_encode($result->getPayload(), JSON_PRETTY_PRINT));
$io->writeln(json_encode($payload, JSON_PRETTY_PRINT));
return 1;
}

Expand Down

0 comments on commit a854cdf

Please sign in to comment.