Drupal – Drush Make Global Defaults

I’m a big fan of Drush and its bundled feature Drush Make. Drush Make used to be its own project separate from Drush — for some time now it has been included into Drush core.

When using Drush make there are default options set by drush when you run certain commands. Typically the default option is fine for the command you are running. For instance the default location when using `drush download MODULE_NAME` is to download the module to your /sites/all/modules directory of your Drupal installation.

When developing an Installation Profile using Drush Make or a custom project simply built from a Drush Make file — sometimes we want to tweak these default Drush behaviors. Drush Make supports overrides of these defaults. For instance the following makefile changes the default location for downloaded modules from the “modules” directory; to a directory called “contrib” within the default modules directory:

api = 2
core = 7.x

// This option overrides a "default" behavior in Drush Make.
defaults[projects][subdir] = contrib

;;;;;;;;;;  Modules

projects[securepages]           = 1.0-beta2
projects[devel]                 = 1.3
projects[strongarm]             = 2.0
projects[features]              = 1.0

By overriding defaults such as these we can get more flexibility in tools we’re using! Sweet. This also helps by making your Drush Makefiles less verbose. There are some active issues to streamline Drush Makefiles even further in the future with more magic shorthand notations.

Looking for quality Drupal Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , | Posted under Drupal, Drush | RSS 2.0

Author Spotlight

David Gurba

I am a web programmer currently employed at UCSB. I have been developing web applications professionally for 8+ years now. For the last 5 years I’ve been actively developing websites primarily in PHP using Drupal. I have experience using LAMP and developing data driven websites for clients in aviation, higher education and e-commerce. If you’d like to contact me I can be reached at david.gurba@arvixe.com

Leave a Reply

Your email address will not be published. Required fields are marked *