From 5715f3408680bdfaf8b9fd632330c1882b910da9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 16 Dec 2020 07:37:30 +1100 Subject: [PATCH] Better error handling with self updater --- app/Console/Commands/PostUpdate.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/PostUpdate.php b/app/Console/Commands/PostUpdate.php index b735f41e64f0..08bf548ef4e7 100644 --- a/app/Console/Commands/PostUpdate.php +++ b/app/Console/Commands/PostUpdate.php @@ -16,6 +16,7 @@ use Composer\Console\Application; use Illuminate\Console\Command; use Illuminate\Support\Facades\Artisan; use Symfony\Component\Console\Input\ArrayInput; +use Symfony\Component\Console\Output\BufferedOutput; class PostUpdate extends Command { @@ -57,10 +58,11 @@ class PostUpdate extends Command $input = new ArrayInput(['command' => 'install', '--no-dev' => 'true']); $application = new Application(); $application->setAutoExit(false); + $output = new BufferedOutput(); $application->run($input, $output); info(print_r($output->fetch(),1)); - + try { Artisan::call('optimize'); } catch (\Exception $e) {