-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Throw a new exception after catching Cannot apply patch , so that Com… #31
Conversation
…poser install fails
I agree with the intent of this patch, but I think it needs a bit of work first. Some people may just want to continue, some may want it to stop. For now, let's leave the default behavior as-is, but add a way for users to opt-in to throwing another exception so that the I'm thinking something like this:
@pivulic Do you want to do this? |
One suggestion would be to be able to set "exit-on-patch-failure" as an environment variable. Then you can fail or not fail "composer install / update" depending on the environment. In a build environment it's important to fail the build if a patch is not correctly applied. Example:
|
👍 Agree with @moleman |
What about now? :) |
Committed in 0d75c63 -- added a space, changed some copy, and added some detail to the commit message, but it's all still credited to you. Thanks! |
Thanks! By the way, when will this be included in a new release? :) |
When there's enough to justify a new release - 1-2 months tops. |
Would it be possible to release a minor version at least, i.e. 1.3.1? :) That way, we can use your package from https://packagist.org/ instead of our fork in our projects. |
Actually, now that I look at it, there hasn't been a release in a long time (July 2015). I think it's time for a 1.4.0 release. I'll do that in the next day or two. |
@pivulic FYI, there is now a 1.4.0 release. Thanks again! |
GR8! |
Problem
When a patch fails, an exception is thrown from: https://github.com/cweagans/composer-patches/blob/master/src/Patches.php#L349
The exception is then catched in https://github.com/cweagans/composer-patches/blob/master/src/Patches.php#L264
During the Composer install, the patch fails to be applied and the user is informed about the error, but the install process continues.
Expected Result
If a patch fails to be applied, an exception should be thrown so that Composer fails the install and the user is notified about the error. Today, if the Composer installs several packages, the user might not wait for the entire install to finish and might therefor miss that a patch failed.