Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This patch creates a project_defaults array for specifying attributes common to all projects. For instance, the subdir attribute:
; Specify common subdir of "contrib"
project_defaults[subdir] = "contrib"
; Override default value
projects[devel][subdir] = "development"
Comment | File | Size | Author |
---|---|---|---|
#4 | drush-make-defaults-1633050-04.patch | 3.96 KB | jhedstrom |
drush-make-project-defaults.patch | 2.77 KB | jhedstrom |
Comments
Comment #1
patcon CreditAttribution: patcon commentedThis is worlds beyond better than the alternative in #1109002: Setting the default subdir. Thanks @jhedstrom!
Comment #2
msonnabaum CreditAttribution: msonnabaum commentedMake has needed this for a long time, well done.
Patch looks good. Something looks off about the terminology, but I don't feel too strongly about it. I might have done this instead:
That looks cleaner to me and will let us have defaults for other non-projects.
Comment #3
patcon CreditAttribution: patcon commented++
Comment #4
jhedstromGreat idea Mark. This patch switches to the more general
defaults
array, and also applies those prior to running validate so that these can still be used when packaging for d.o. w/o changes needed in drupalorg_drush.Comment #5
jhedstromOpened #1653298: Allow new top-level attribute 'defaults' so these defaults could be used for packaging on d.o.
Comment #6
jhedstromCommitted #4 in 02bf690 with slightly more verbose docs.
Comment #7
jonhattanThis makefile booms:
Defaults must be applied after projects[] is expanded.
Comment #8
jhedstromThat's quite the bug. I committed a fix in 1095329. Simply moving where defaults are applied cleared this up.
Comment #9
DamienMcKennaThe following downloads core to a directory named "contrib" rather than the current directory:
And the command that I used:
Do you want me to open a new issue for this?
Comment #10
DamienMcKennaFYI this is what I had to use to work around the bug mentioned in #9:
Comment #11
jhedstrom@DamienMcKenna a new issue would be great--I think the fix is to disallow subdir on the core project, but I may be overlooking something.
Also, setting status back to feature request.
Comment #12
DamienMcKennaNew issue added: #1678774: defaults[projects][subdir] downloads core to the wrong place
Comment #14
jyee CreditAttribution: jyee commentedFWIW, the issue that affected core also applies to themes. So you end up with things like themes/contrib/themename instead of just themes/themename. Fix in #10 works to resolve the issue.
Comment #15
patcon CreditAttribution: patcon commentedI feel this behavior for themes would be correct, right? These's are a type of project project that you tend to have contrib and custom directories for. When you're building an install profile, you've got your contrib themes and custom themes, and you use a gitignore like so:
Comment #16
jhedstromAgree with #15 that using a contrib subdirectory for themes is okay, and even preferable. For those that want a subdir for modules, but not for themes, the syntax in #10 will work.