Skip to content

Commit 1c487b5

Browse files
[7.x] Throw a warning when Runway config file already exists (#1131)
* Throw a warning when Runway config file already exists * whoops
1 parent f9109a2 commit 1c487b5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Console/Commands/SwitchToDatabase.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,14 @@ protected function copyBlueprintStubs(): self
8888

8989
protected function publishRunwayConfig(): self
9090
{
91-
if (! File::exists(config_path('runway.php'))) {
92-
File::copy($this->stubsPath.'/runway_config.php', config_path('runway.php'));
91+
if (File::exists($path = config_path('runway.php'))) {
92+
$this->components->warn("You already have Runway installed. Please copy the config from {$this->stubsPath}/runway_config.php into your existing config file.");
93+
94+
return $this;
9395
}
9496

97+
File::copy($this->stubsPath.'/runway_config.php', $path);
98+
9599
$this->components->info('Published Runway config file successfully');
96100

97101
return $this;

0 commit comments

Comments
 (0)