From a6cb30a609a997386533201344196f01bcd90e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Koterba?= Date: Wed, 11 Sep 2024 22:54:55 +0200 Subject: [PATCH] Add keep-config option to install command (#946) * Add keep-config option * update pr * formatting --------- Co-authored-by: Taylor Otwell --- src/Commands/InstallCommand.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index eb69f6eb4..b2c4b84bf 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -22,7 +22,8 @@ class InstallCommand extends Command * @var string */ public $signature = 'octane:install - {--server= : The server that should be used to serve the application}'; + {--server= : The server that should be used to serve the application} + {--force : Overwrite any existing configuration files}'; /** * The command's description. @@ -53,7 +54,10 @@ public function handle() if ($installed) { $this->updateEnvironmentFile($server); - $this->callSilent('vendor:publish', ['--tag' => 'octane-config', '--force' => true]); + $this->callSilent('vendor:publish', [ + '--tag' => 'octane-config', + '--force' => $this->option('force'), + ]); $this->components->info('Octane installed successfully.'); $this->newLine(); @@ -78,6 +82,7 @@ public function updateEnvironmentFile($server) PHP_EOL.'OCTANE_SERVER='.$server.PHP_EOL, ); } else { + $this->newLine(); $this->components->warn('Please adjust the `OCTANE_SERVER` environment variable.'); } }