From a051773bc20d59f587537e3604976c2e71839a33 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Wed, 13 Feb 2019 12:01:52 +0100 Subject: [PATCH] Fix Bref CLI exit code --- bref | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bref b/bref index 5703985a3..8723c606f 100755 --- a/bref +++ b/bref @@ -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('Logs:'); $io->write('' . $result->getLogs() . ''); $io->writeln('Lambda result payload:'); - $io->writeln(json_encode($result->getPayload(), JSON_PRETTY_PRINT)); + $io->writeln(json_encode($payload, JSON_PRETTY_PRINT)); return 1; }