Skip to content

Commit

Permalink
[1.x] Don't error when docker is not available (#468)
Browse files Browse the repository at this point in the history
* Don't error when docker is not available

* Update InstallCommand.php

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
jessarcher and taylorotwell authored Aug 17, 2022
1 parent 1f870bc commit 853dea1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function handle()

$this->info('Sail scaffolding installed successfully.');

return $this->prepareInstallation($services);
$this->prepareInstallation($services);
}

/**
Expand Down Expand Up @@ -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.');
}

/**
Expand Down

0 comments on commit 853dea1

Please sign in to comment.