Quick tip: Download and enable a module with one Drush command
Us developers tend to be efficiency driven - constantly on the search for productivity gains that allow us to work faster.
Drush makes easy work of downloading and enabling new modules or themes with the pm-download and pm-enable commands.
To download a new module or theme from drupal.org, simply run the following command:
- drush dl module_name
dl is an alias for pm-download
And when that has finished downloading, run:
- drush en module_name
en is an alias for pm-enable
But there is an even easier way. Rather than running both commands, you can simply run the pm-enable (en) command and skip the pm-download (dl) command entirely. If the module/theme has not been downloaded yet, Drush will automatically download it.
- drush en module_name -y
For example, to download and enable the diff module, run:
- drush en diff -y
Adding -y to the command skips the prompts asking you confirm that you want to download and enable the module. More time saving!
After you run the command, you will see the following returned:
That is a 50% time saving! Every productivity optimisation like this, however small, makes a difference.