Skip to content

Commit

Permalink
Add keep-config option to install command (#946)
Browse files Browse the repository at this point in the history
* Add keep-config option

* update pr

* formatting

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
MatusBoa and taylorotwell authored Sep 11, 2024
1 parent d1acd65 commit a6cb30a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Commands/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
Expand All @@ -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.');
}
}
Expand Down

0 comments on commit a6cb30a

Please sign in to comment.