Download and enable module quicker using drush

Public

Download and install module with one command without confirmation.
I know, this is a very trivial snippet ;)

</> CopyGet raw version
bash
  1. drush dl custom_module && drush -y en $_

Comments

pierrelbz's picture

And for disable and uninstall a module quick
drush dis -y custom_module && drush pm-uninstall -y custom_module

fadehelix's picture

Thx for great addition. Why isn't there option to vote on comments ? :(

sbilde's picture

..- Or you can put these two functions with the module name as parameter, in your .bash_profile or .bashrc

  1. # Download and install contrib module
  2. function dlen() {
  3. drush dl $1 && drush -y en $1
  4. }
  5. # Disable and uninstall contrib module
  6. function disun() {
  7. drush dis -y $1 && drush pm-uninstall -y $1
  8. }

So for example download and install the token module:
dlen token

..- And disable and uninstall the token module:
disun token

tomhung's picture

Don't forget if you make patches to download the original from git.

  1. # Download and install contrib module (from git)
  2. function drushgit() {
  3. drush dl $1 --package-handler=git_drupalorg && drush -y en $1
  4. }
tomhung's picture

You might also want to do a --select to pick the specific version.

  1. # Download and install contrib module (select version, usually .dev)
  2. function drushselect() {
  3. drush dl --select $1 && drush -y en $1
  4. }