Skip to content

Expecting non-zero exit code after "**ERROR** Failed to apply patch ..." #241

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

Open
cakoose opened this issue Jun 19, 2020 · 1 comment
Open

Comments

@cakoose
Copy link

cakoose commented Jun 19, 2020

We inadvertently upgraded a package, causing it's patch file to no longer apply. While patch-package printed an error message, it still returned an exit code of zero. This caused us to not catch the issue in CI. It should return a non-zero exit code, right?

$ ./node_modules/.bin/patch-package --patch-dir node_module_patches_dev
patch-package 6.2.1
Applying patches...

**ERROR** Failed to apply patch for package nyc at path

    node_modules/nyc

  This error was caused because nyc has changed since you
  made the patch file for it. This introduced conflicts with your patch,
  just like a merge conflict in Git when separate incompatible changes are
  made to the same piece of code.

  Maybe this means your patch file is no longer necessary, in which case
  hooray! Just delete it!

  Otherwise, you need to generate a new patch file.

  To generate a new one, just repeat the steps you made to generate the first
  one.

  i.e. manually make the appropriate file changes, then run

    patch-package nyc

  Info:
    Patch file: patches/nyc+15.0.1.patch
    Patch was made for version: 15.0.1
    Installed version: 15.1.0

✨  Done in 0.69s.
$ echo $?
0
@Gudahtt
Copy link

Gudahtt commented Feb 17, 2021

This looks like a duplicate of #239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants