composer-patches
composer-patches copied to clipboard
Throw exception if patch is not available
When patch is not installed, the plugin will error with the generic "Cannot apply patch" error message. It took me quite a while today to figure out why things were running fine locally but not in our CI Docker image. Apparently, patch was not installed by default in the Debian Slim images.
It would be nice if the plugin could fail with a more precise error message when patch is not available.
Please config as the doc says here https://github.com/cweagans/composer-patches#error-handling
@skyred that's the configuration I use. But that does not solve the issue I raised. I would like to see a clearer error message when the patch tool was not found. "Cannot apply patch" is too generic to be useful. That sounds like the patch file can't be applied because the patch is wrong (whatever that means) but in my case, the patch tool was missing in the Docker container.
Hello - I've run into this too and it took me a bit to find, what's wrong. One should expect that devs can came to a new project (like me) which do not have readme of this library, thus they don't know, what to expect/install (for example I expect things from composer "just works (tm)"). So yes, it would be nice to throw nice and loud exception with error message about missing patch tool.
I've made a note to do this in #447
@cweagans awesome! Thx!