Skip to content

Commit

Permalink
[1.x] Allow force deleting vanity domain without confirmation (#258)
Browse files Browse the repository at this point in the history
* Allow force deleting vanity domain without confirmation

* missed import
  • Loading branch information
orkhanahmadov authored Dec 13, 2024
1 parent 506db1f commit 04b5c19
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Commands/VanityDomainDeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Laravel\VaporCli\Helpers;
use Laravel\VaporCli\Manifest;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;

class VanityDomainDeleteCommand extends Command
{
Expand All @@ -18,6 +19,7 @@ protected function configure()
$this
->setName('vanity-domain:delete')
->addArgument('environment', InputArgument::REQUIRED, 'The environment name')
->addOption('force', null, InputOption::VALUE_NONE, 'Force deletion of the vanity domain without confirmation')
->setDescription('Delete the vanity domain associated with the given environment');
}

Expand All @@ -29,8 +31,9 @@ protected function configure()
public function handle()
{
$environment = $this->argument('environment');
$forceDeletion = $this->option('force');

if (! Helpers::confirm("Are you sure you want to delete the vanity domain of the [{$environment}] environment", false)) {
if (! $forceDeletion && ! Helpers::confirm("Are you sure you want to delete the vanity domain of the [{$environment}] environment", false)) {
Helpers::abort('Action cancelled.');
}

Expand Down

0 comments on commit 04b5c19

Please sign in to comment.