-
Notifications
You must be signed in to change notification settings - Fork 486
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
Add a --force option to the publish command #669
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -11,14 +11,15 @@ class PublishCommand extends Command | |||||
* | ||||||
* @var string | ||||||
*/ | ||||||
protected $signature = 'sail:publish'; | ||||||
protected $signature = 'sail:publish | ||||||
{--force : The services that should be included in the installation}'; | ||||||
|
||||||
/** | ||||||
* The console command description. | ||||||
* | ||||||
* @var string | ||||||
*/ | ||||||
protected $description = 'Publish the Laravel Sail Docker files'; | ||||||
protected $description = 'Publish the Laravel Sail Docker files. If you want overwrite the existing files, you can add the `--force` option'; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for the extra explanation here.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @driesvints, thanks for your suggestions. |
||||||
|
||||||
/** | ||||||
* Execute the console command. | ||||||
|
@@ -27,8 +28,13 @@ class PublishCommand extends Command | |||||
*/ | ||||||
public function handle() | ||||||
{ | ||||||
$this->call('vendor:publish', ['--tag' => 'sail-docker']); | ||||||
$this->call('vendor:publish', ['--tag' => 'sail-database']); | ||||||
if ($this->option('force')) { | ||||||
$this->call('vendor:publish', ['--tag' => 'sail-docker', '--force' => '1']); | ||||||
$this->call('vendor:publish', ['--tag' => 'sail-database', '--force' => '1']); | ||||||
} else { | ||||||
$this->call('vendor:publish', ['--tag' => 'sail-docker']); | ||||||
$this->call('vendor:publish', ['--tag' => 'sail-database']); | ||||||
} | ||||||
|
||||||
file_put_contents( | ||||||
$this->laravel->basePath('docker-compose.yml'), | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.