szeidler/composer-patches-cli

Do patches have to be declared in a separate file?

Closed this issue · 2 comments

The cweagans/composer-patches project allows patches to de declared in a separate file, or an extra.patches section of the root composer.json

The README for this CLI tool implies that using a separate patches file is necessary. Is that correct?

My steps:

  • I already have several patched drupal contrib modules. The patches are declared in my composer.json file, in the extra.patches section.
  • Then I required szeidler/composer-patches-cli
  • Running composer patch-list works. It lists all the projects I already use patches for.
  • composer patch-add didn't work... [Exception] Patch file was not defined in your composer.json.
  • composer patch-enable. Now a composer.patches.json file has been created.
  • composer patch-add seems to work now. The patch is mentioned in composer.patches.json
  • But the patch doesn't get applied ever.
  • I deleted the entire extra.patches section of my composer.json
  • now the patches defined in composer.patches.json get applied.

So it seems that I can only use place for declaring patches. I think that may be a limitation of cweagans/composer-patches, which is fine.

But does composer-patches-cli only work with a separate patches file?

Hi,

currently inline patch definitions in extra.patches of the composer.json are not supported in szeidler/composer-patches-cli. But it shouldn't be hard to support this too.

But the patch doesn't get applied ever.

On which version of szeidler/composer-patches-cli are you? 1.0.0? Here the patch-add command should immediately trigger updating the patched package (to apply the patch).

This got resolved in the attached PR. Inline patches are supported now.