Most of the time the default download path that Drush uses for modules is perfectly fine (sites/all/modules), and until this week I’ve never had a reason to alter it. However, I happen to be working on an Aegir multisite install right now and I’ve been given access to only the site specific folder for that domain (meaning I don’t have remote access to sites/all/modules). In this case downloading modules to the sites all folder while developing on my local machine is not a good idea as it would require remembering which modules needed to be moved.
After searching a bit through quite a few contradictory posts giving instructions which didn’t seem to work I decided to go ahead and write out what worked for me. Chances are somewhere down the line I’ll end up googling the question again and find this article (it’s happened to me more than once already).
To start, go to your drush folder where you will find a file entitled example.drushrc.php. Copy that file into the individual site folder in your Drupal multisite installation (sites/yourmultisite), and rename the file to drushrc.php.
Now open that file and add the following line:
$command_specific[‘dl’][‘destination’] = ‘sites/yourmultisite/modules’;
$command_specific[‘dl’][‘destination’] = ‘sites/yourmultisite/modules/contributions’;
Adding the contributions folder is optional, but it helps keep things organized if you have a lot of custom modules you are working on.
Now in a single site installation downloading a module is done by typing “drush dl examplemodule”, however in a multisite environment the command is slightly different: “drush -l yourmultisite dl examplemodule”.
That’s really all there is to it. Any command that you want to affect only a particular domain you call it by adding the -l modifier followed by the foldername of that site.
Hope this helped.
- Jquery Menu Module
- Advanced Book Blocks
- Advanced Taxonomy Blocks
- Consistent Language Interface
Stay informed on our latest news!Email: * Previous issues
Drupal Tutorals RSS
How to Declare a Views Template Inside of a Module
How to Remove all SVN Folders from a Site
Svn has an annoying habit of adding thousands of folders and files into every level of your site when you put your code under…[Read More]
How to turn off Vertical Tabs for a specific content type
I rarely do any heavy structural changes to node edit pages, so until today I hadn’t ever had a reason to disable vertical tabs…[Read More] Drupal Tutorials Drupal Blog RSS
Free, Unlimited, Private Git Hosting – The Holy Grail of Version Control
If I were paid minimum wage for the time I have spent investigating various git and svn hosting services (both free and paid) I…[Read More]
Mac OSX + Drush = Time saved
The longer I have my mac the more things I find that drastically simplify my life as a Drupal developer. Now for fairness sake I…[Read More]
New to Drupal? A word from the wise: Never say newbie!
I have nothing against new Drupal users on Drupal.org, even the most advanced Drupal developers were new to Drupal at one point…[Read More] Drupal Blog
- Refund Policy
- Business Ethics
- View Drupal.org profile
- Follow us on Twitter
- Subscribe through RSS