Skip to content
Snippets Groups Projects
Commit 2b6a75eb authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-5605: adding drush command for migration clean up

parent 9303de8b
No related branches found
No related tags found
1 merge request!247Feature/istwcms 5605 ebremner migration clean up
...@@ -227,4 +227,36 @@ class UwDrushCommands extends DrushCommands { ...@@ -227,4 +227,36 @@ class UwDrushCommands extends DrushCommands {
return $path; return $path;
} }
/**
* Drush command to cleanup after a migration.
*
* @command mim:cleanup
* @aliases mimcu
* @usage mimcu
*/
public function migrationCleanUp() {
// Modules to uninstall.
$modules = [
'uw_migrate',
'webform_migrate',
'webform_node'
];
// Step through each of the modules, ensure that they
// are enabled, and if enabled, uninstall.
foreach ($modules as $module) {
// If the module is enabled, uninstall it.
if (\Drupal::service('module_handler')->moduleExists($module)) {
// Uninstall the module.
\Drupal::service('module_installer')->uninstall([$module]);
// Log to the screen.
$this->logger()->success('Uninstalled: ' . $module);
}
}
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment