Adding a confirm message to delete:module command, to prevent accidental deletions

parent 2430c10e
......@@ -43,6 +43,15 @@ class DeleteModuleCommand extends Command
{
$module = $this->argument('module');
$extra = '';
if ($this->option('migrations') === true) {
$extra = ' and reset its tables';
}
if ($this->confirm("Are you sure you wish to delete the [$module] module{$extra}?") === false) {
$this->info('Nothing was deleted');
return;
}
$modulePath = config('modules.paths.modules') . '/' . $module;
if ($this->finder->exists($modulePath) === false) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment