Skip to content

Commit

Permalink
[1.x] Allow using --force on domain record deletion (#246)
Browse files Browse the repository at this point in the history
* Update RecordDeleteCommand.php

* fixes
  • Loading branch information
orkhanahmadov authored Jan 17, 2024
1 parent 4aa65a3 commit b4982df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Commands/RecordDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Laravel\VaporCli\Helpers;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;

class RecordDeleteCommand extends Command
{
Expand All @@ -20,6 +21,7 @@ protected function configure()
->addArgument('type', InputArgument::REQUIRED, 'The record type')
->addArgument('name', InputArgument::OPTIONAL, 'The record name')
->addArgument('value', InputArgument::OPTIONAL, 'The record value')
->addOption('force', false, InputOption::VALUE_NONE, 'Force deletion of the record without confirmation')

This comment has been minimized.

Copy link
@grey-dev-0

grey-dev-0 Jan 31, 2024

The false argument sent here is breaking vapor CLI deployments because of the latest symfony/console update, replacing it with null would solve the issue.

->setDescription('Delete a DNS record');
}

Expand All @@ -30,7 +32,9 @@ protected function configure()
*/
public function handle()
{
if (! Helpers::confirm('Are you sure you want to delete this record', false)) {
$forceDeletion = $this->option('force', false);

if (! $forceDeletion && ! Helpers::confirm('Are you sure you want to delete this record', false)) {
Helpers::abort('Action cancelled.');
}

Expand Down

0 comments on commit b4982df

Please sign in to comment.