protected function execute(InputInterface $input, OutputInterface $output)
{
$this->detectMagento($output, true);
if (!$this->initMagento()) {
return;
}
$moduleName = $this->getModule($input);
$setupName = $input->getArgument('setup');
$moduleSetups = $this->getModuleSetupResources($moduleName);
if (empty($moduleSetups)) {
$output->writeln(sprintf('No setup resources found for module: "%s"', $moduleName));
return;
}
if ($setupName === 'all') {
foreach ($moduleSetups as $setupCode => $setup) {
$this->removeSetupResource($moduleName, $setupCode, $output);
}
} elseif (array_key_exists($setupName, $moduleSetups)) {
$this->removeSetupResource($moduleName, $setupName, $output);
} else {
throw new InvalidArgumentException(sprintf('Error no setup found with the name: "%s"', $setupName));
}
}