It's tedious to disable modules before uninstalling them. At least that's what I decided today when I caught myself resorting this kind of silliness on the commandline:

$ for MODULE in dashboard help overlay toolbar
> do
> drush dis $MODULE
> drush pm-uninstall $MODULE
> done

Oftentimes I don't think of disabling and uninstalling a module as discrete actions—sometimes I just wanna kill-it-dead without concerning myself with how many steps that actually takes under the hood.

Maybe pm-uninstall could have some kind of switch for such behavior like --force or --disable.

Comments

greg.1.anderson’s picture

greg.1.anderson’s picture

Closed #1999706: Recursive pm-uninstall as a duplicate of this. Request came from a slightly different angle, though: recursive uninstall. If we made disable == uninstall the same Drush command, it would take care of both requests, though.

greg.1.anderson’s picture

Status: Active » Closed (won't fix)
Issue tags: +Needs migration

This issue was marked closed (won't fix) because Drush has moved to Github.

If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to closed (duplicate).

Please ask support questions on Drupal Answers.

norman.lol’s picture

Issue summary: View changes

Simply create a bash function in your .bash_profile:

# drush disable & uninstall in 1 step
# arg1 module machine name
dust () {
  drush dis $1 -y && drush pm-uninstall $1 -y
}

Then you simply can type
dust module_name
and you are done.