I need to include a patch in my project. I have included cweagans/composer-patches in composer.json and added the following lines in the extra section (example is from when trying to enable distribution in the Configuration installer).
"patches": {
"drupal/config_installer": {
"Enable distribution for Configuration installer profile": "patches/config_installer_enable_distribution.patch"
}
}
Afterwards, I run composer update
.
- Installing drupal/config_installer (1.5.0): Loading from cache
- Applying patches for drupal/config_installer
patches/config_installer_enable_distribution.patch (Enable distribution for Configuration installer profile)
So I get no errors and the patch seems to have been applied successfully. Also the file PATCHES.txt
is successfully created in the package's root directory. Still, the patch hasn't been applied.
I've tried this method with other packages which come from Github and it works, however every time I try this with a module or a profile from drupal.org then the patch isn't being applied.
Am I missing anything?
When I ran composer update -vvv
, I saw the command which is running for the patch is indeed with Git.
git -C 'web/profiles/contrib/config_installer' apply '-p1' '/path/to/project/patches/config_installer_enable_distribution.patch'
I've tried running the command by itself; again, it didn't change the file.