Closed (fixed)
Project:
Module Builder
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2010 at 18:17 UTC
Updated:
31 Dec 2011 at 19:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
joachim commentedIt puts it in /sites/all/modules, unless you tell it otherwise. What command are you using?
Comment #2
frobdrush mb module_name node_info menu --write
I just double checked it, yea that is what happens to me.
I am using drush 3.3
Comment #3
joachim commentedSorry, I can't reproduce this with Drush 3.x.
There might be some Drush special-casing where if the /contrib folder exists it goes for that -- try it when that doesn't exist.
Comment #4
frobI just tested it and that seems to be the case.
If there is a contrib directory then I puts it in there, if not then it just puts it in the module directory.
I would put this under category "Annoying" if it existed.
Comment #5
joachim commentedOk so what's causing it is this:
On the one hand, Drush wants to be helpful, so 'drush dl' downloads modules to modules/contrib if that exists, and /modules if not. That's fair enough.
Then module builder tries to figure out where to write a new module. To do this, I've just hijacked 'drush dl' to give me a location for the modules folder. So the problem is here.... we shouldn't rely as much on dl's internal stuff.
Comment #6
frobhow about just adding a validation. If those are the only two options that drush dl gives us then we could just validate what dl gives us.
put an if check after the path is retrieved.
if (path returned by dl) ends with "/contrib" {
remove "/contrib"
}
I don't have time to write a patch for this but just turn that into real code and that should work then, right?
Comment #7
joachim commentedHmm, you're right, hacking it out is probably the way to go, as this is quite deep in drush pm:
Comment #8
joachim commentedHere's a patch I don't have time to commit right now... feel free to give it a try.
Comment #9
aaronott commentedYep that works for me, but only if custom exists as well. What if it checks to see if custom exists, if not go ahead and add to contrib or I suppose you could add to modules instead.
quick patch (I only added a bit of checking to your patch)
Comment #10
joachim commentedThanks for the patch!
Fixed on 7.x.
Issue #966930 by aaronott, joachim: Fixed module being written to 'contrib' subfolder when it exists.
I should probably cherry-pick this one to 6...
Comment #11
joachim commentedPushed to 6 too.
Comment #13
donquixote commentedIt should rather put those modules into sites/all/modules/custom, if that exists, and sites/all/modules, otherwise.
Besides, it would be nice to have an option to create in the current location.
Comment #14
joachim commented> It should rather put those modules into sites/all/modules/custom, if that exists, and sites/all/modules, otherwise.
That's what it does.
> Besides, it would be nice to have an option to create in the current location.
See the --parent option.
Comment #15
donquixote commentedNot for me :(
They currently all go in sites/all/modules, even though sites/all/modules/custom does exist.
Besides, mb does not tell where it puts a module. I have to look myself.
Could this be caused by my drush settings?
(don't know where to find those, atm..)
Comment #16
joachim commentedWorks for me.
Check you have the most recent mb.
What's your version of drush?