Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] Don't error when docker is not available #468

Merged
merged 2 commits into from
Aug 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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