-
-
Notifications
You must be signed in to change notification settings - Fork 301
patch-package should support patching itself in postinstall
script
#203
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
Comments
I am about to do similar (attempt to patch patch-package) and I think this is achievable as-is by modifying your postinstall Specifically,
That way your patch-package patches should go in, and should go first, then it will do it's normal run. Should work? |
@mikehardy, great suggestion! I wasn't aware of the |
@pdcastro quick! Propose a PR for the help doc and claim the internet points 🏆 before someone else does 😄 https://github.com/ds300/patch-package/blob/master/src/index.ts#L104 |
@mikehardy, I think you have a rightful claim for those points, 😄 and I am already collecting lots elsewhere at the moment! 💰 |
Mine all mine, precious internet points #225 |
patch-package
is great, so much so that I recently found myself attempting to use it to patchpatch-package
itself as I came across issue #201. It didn't work, at least in my setup, using"postinstall": "patch-package"
in thepackage.json
file. What I think was happening is that by the timepatch-package
had patched itself, it was too late -- the old unpatched code was already being used to patch other packages.Perhaps the solution might be for
patch-package
to detect if one of the patch files is forpatch-package
itself, and if so, apply that patch first, then re-exec itself before continuing with other patches. (When re-exec'ing, perhaps add a command-line option like--no-self-patch
to prevent patching itself in a loop.) :-)The text was updated successfully, but these errors were encountered: