Skip to content
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

Can't create patches if there are also shell scripts used in preinstall/postinstall #52

Closed
dawnmist opened this issue May 8, 2018 · 2 comments

Comments

@dawnmist
Copy link

dawnmist commented May 8, 2018

If there are additional actions required during normal pre/post install for the program, the patch-package tries to run those as well as part of the build new package process. However, because it has not copied them to the temp build directory, those scripts cannot be found so the build fails.

For example:
./util/pre-install.sh

#!/bin/bash
if [ ! -f "${PWD}/.env"]
then
    echo "REACT_APP_DEMO_MODE=true"
fi

package.json:

{
  "scripts": {
    "preinstall": "./util/pre-install.sh",
    "postinstall": "patch-package"
  }
}

The failure log states that the "./util/pre-install.sh" script was not found in the temp directory.

@ds300
Copy link
Owner

ds300 commented May 8, 2018

Hi! 👋 Thanks for the report. That makes perfect sense. The scripts entry should probably be deleted from the package.json copy that is used in the temp directory.

I'll try to take a look at doing that by tomorrow evening.

@ds300
Copy link
Owner

ds300 commented May 9, 2018

Hi again! I forgot that I already tackled this issue in 6.0.0-3 (#47) but apparently I made a stupid mistake and it didn't actually fix the problem. I've tried again, and this time I added a regression test for extra certainty :D

It's available in 6.0.0-5 — Thanks for your patience! 🙇

@ds300 ds300 closed this as completed May 9, 2018
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