Problem/Motivation

When running drush radix with a kit that includes alterations in the include files, those files do not get automatically updated with the new subtheme's Name, Description or machine name.

Proposed resolution

Add the include files into the $files_to_replace array when generating a new subtheme.

CommentFileSizeAuthor
#3 radix-search_includes_during-2847486-3.patch686 bytesbneil

Comments

bneil created an issue. See original summary.

bneil’s picture

Issue summary: View changes
bneil’s picture

Assigned: bneil » Unassigned
Status: Active » Needs review
StatusFileSize
new686 bytes

Here is a patch that uses the scandir() function to search the specified kit for includes and add them to the $files_to_replace array.

In my testing and on the php.net scandir() documentation page, the scandir() function also returns array items of '.' and '..' which are not desirable. To remove those, I used array_diff() instead of array_slice() in case other operating systems do not include those items.

shadcn’s picture

Yeah this looks good. Testing...

shadcn’s picture

Assigned: Unassigned » shadcn
adam-delaney’s picture

I've tested this creating my own starter kit and using {{machine_name}} pattern and it works great.

shadcn’s picture

Status: Needs review » Reviewed & tested by the community

Looks good. Will commit.

  • arshadcn committed ff6f99f on 7.x-3.x authored by bneil
    Issue #2847486 by bneil: Search includes during drush subtheme creation
    
shadcn’s picture

Status: Reviewed & tested by the community » Fixed

Committed. Thanks @bneil. Thanks @adam-delaney.

Status: Fixed » Closed (fixed)

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