From a012eb1f0e48a15fd312c68f6468bf8474e47547 Mon Sep 17 00:00:00 2001 From: Jess Archer Date: Wed, 17 Aug 2022 15:26:57 +1000 Subject: [PATCH 1/2] Don't error when docker is not available --- src/Console/InstallCommand.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index ff027c66..e4abba08 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -72,7 +72,7 @@ public function handle() $this->info('Sail scaffolding installed successfully.'); - return $this->prepareInstallation($services); + $this->prepareInstallation($services); } /** @@ -211,22 +211,23 @@ protected function installDevContainer() * Prepare the installation by pulling and building any necessary images. * * @param array $services - * @return int|null + * @return void */ protected function prepareInstallation($services) { + // Ensure docker is installed + if ($this->runCommands(['docker info > /dev/null 2>&1']) !== 0) { + return; + } + $status = $this->runCommands([ './vendor/bin/sail pull '.implode(' ', $services), './vendor/bin/sail build', ]); - if ($status !== 0) { - $this->warn('Unable to download and build your Sail images. Is Docker installed and running?'); - - return 1; + if ($status === 0) { + $this->info('Sail images installed successfully.'); } - - $this->info('Sail images installed successfully.'); } /** From f67606f84925520afd48e7a09a99e5b393d27402 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 17 Aug 2022 08:16:41 -0500 Subject: [PATCH 2/2] Update InstallCommand.php --- src/Console/InstallCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index e4abba08..1de61e10 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -215,7 +215,7 @@ protected function installDevContainer() */ protected function prepareInstallation($services) { - // Ensure docker is installed + // Ensure docker is installed... if ($this->runCommands(['docker info > /dev/null 2>&1']) !== 0) { return; }