Skip to content

Commit 3eb6750

Browse files
committed
Check the existence of docker-compose before executing other logics
1 parent 2b55e1e commit 3eb6750

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Console/SailEnvCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ class SailEnvCommand extends Command
3232
*/
3333
public function handle()
3434
{
35+
if (! file_exists($this->laravel->basePath('docker-compose.yml'))) {
36+
$this->error('docker-compose.yml not found. Please run "php artisan sail:install" first.');
37+
38+
return 1;
39+
}
40+
3541
if ($this->option('overwrite')) {
3642
$this->comment('Overwriting environment variables');
3743
$this->createEnvFile();
@@ -43,12 +49,6 @@ public function handle()
4349
$this->createEnvFile();
4450
}
4551

46-
if (! file_exists($this->laravel->basePath('docker-compose.yml'))) {
47-
$this->error('docker-compose.yml not found. Please run "php artisan sail:install" first.');
48-
49-
return 1;
50-
}
51-
5252
$services = $this->getServicesFromCompose();
5353

5454
$this->comment('Detected services from docker-compose.yml: ['.implode(',', $services).']');

0 commit comments

Comments
 (0)