composer-patches icon indicating copy to clipboard operation
composer-patches copied to clipboard

Communicate that patch failed due to missing 'patch' command

Open Chekote opened this issue 3 years ago • 1 comments

Problem

When attempting to use this package on a system that does not have the "patch" command installed, you get a vague error message:

Could not apply patch! Skipping. The error was: Cannot apply patch ######

Cause

I spend a long time trying to work out exactly why my patch was not applying. Thinking that it was a problem with the patch file itself. But eventually, I discovered that the package is assuming the system has a "patch" command.

Check if the patch command is present and can be run before trying to use it. If that fails, then clearly communicate to the user what the problem is so they can resolve it:

Could not apply patch! Skipping. The error was: Failed to run the "patch" command. Is it installed on the system?

Chekote avatar Jul 13 '22 20:07 Chekote

howdy @cweagans 👋

Would you mind taking a look at this PR? 🥺

Thanks 🙇

Chekote avatar Aug 08 '22 12:08 Chekote

#447 takes care of this for 2.x.

cweagans avatar Feb 04 '23 07:02 cweagans