Add --no-confirm option to Artisan reset-demo command

This commit is contained in:
Bubka 2020-03-20 21:46:06 +01:00
parent 743e644fd6
commit e2b9b5b685

View File

@ -12,7 +12,7 @@ class ResetDemo extends Command
* *
* @var string * @var string
*/ */
protected $signature = '2fauth:reset-demo'; protected $signature = '2fauth:reset-demo {--no-confirm}';
/** /**
* The console command description. * The console command description.
@ -45,9 +45,13 @@ public function handle()
return; return;
} }
if( $this->option('no-confirm') ) {
$demo = 'demo';
}
else {
$this->line('This will reset the app in order to run a clean and fresh demo.'); $this->line('This will reset the app in order to run a clean and fresh demo.');
$demo = $this->ask('To prevent any mistake please type the word "demo" to go on'); $demo = $this->ask('To prevent any mistake please type the word "demo" to go on');
}
if ($demo === 'demo') { if ($demo === 'demo') {