Many sites follow the best practice of a contrib and cutom directory inside the /sites/all/modules/ directory. But currently drush can only download modules to the /sites/all/modules/ directory, it'd be useful if it checked for a contrib directory and if it existed it would download modules there.

CommentFileSizeAuthor
#4 check-for-contrib.patch723 bytesgreg.1.anderson

Comments

moshe weitzman’s picture

Priority: Normal » Minor

use --destination for now

moshe weitzman’s picture

Assigned: Unassigned » moshe weitzman
Priority: Minor » Normal

I'm inclined to add this. Its pretty easy, and promotes good hygiene

moshe weitzman’s picture

patches welcome. i won't be working on this.

greg.1.anderson’s picture

Status: Active » Needs review
StatusFileSize
new723 bytes

Yep, pretty easy; patch attached.

I was tempted to create a 'contrib' directory if the modules directory did not already exist (actively promote good hygiene), but drush uses the existence of the modules directory as an indicator of where downloads should go, so I decided to leave well enough alone and just do the straightforward thing and use 'contrib' iff it exists.

Does anyone do anything like this for themes? I only handled modules. It would be trivial to move the new four lines from this patch to the end of the 'switch' and make the 'contrib' check apply to all destination types.

moshe weitzman’s picture

Status: Needs review » Fixed

Committed with a code comment. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nvanhove’s picture

#4, this would be good to also have in the theme directory :)

nvanhove’s picture

Status: Closed (fixed) » Active
greg.1.anderson’s picture

Title: Look for contrib directory in modules » Look for contrib directory in modules and themes
moshe weitzman’s picture

Thats a bit much, no? I can't imagine why you would have more than a couple folders in sites/all/themes

nvanhove’s picture

Me neither, but at least it would be consistent.

moshe weitzman’s picture

Status: Active » Closed (fixed)

reset status. not needed for themes.