vaimo / composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and composer command for testing/troubleshooting patches.
MIT License
287 stars 40 forks source link

Allow for wildcard in patcher search #75

Open indykoning opened 3 years ago

indykoning commented 3 years ago

Is your feature request related to a problem? Please describe. In an attempt to keep everything in modules it would be nice to have wildcards work in the search configuration settings. This would allow us to keep the patches in the relevant module without having to add every single module path to the search lising

Describe the solution you'd like Accepting wildcards in the search configuration

"extra": {
        "patcher": {
            "search": ["patches", "app/code/<vendor>/*/patches", "vendor/<vendor>/*/patches"]
        }
    }

Describe alternatives you've considered manually adding the path per module (which is what i'll do for the time being).

indykoning commented 3 years ago

My guess is if we add glob around this line and merge it with the paths glob patterns could work https://github.com/vaimo/composer-patches/blob/aba4a6bac8d5bbb44facf2f47ec6e5d5e13c8445/src/Patch/SourceLoaders/PatchesSearch.php#L101

allanpaiste commented 3 years ago

@indykoning you are correct. I'd be easy to implement as well + would make it more in tune with some other features that do allow wildcards to be used. Will look into this asap.