react-native-builder-bob icon indicating copy to clipboard operation
react-native-builder-bob copied to clipboard

How to use a npm postinstall script with bob?

Open teodorciuraru opened this issue 4 years ago • 1 comments

Hello,

I'm trying to execute a custom script after my package had installed. I'm doing this by settings a "postinstall": "node my-script.sh" in package.json. However, when running bob build, the script is executed and the wrong current working directory is loaded (the directory containing the package, not the example app's)

How can I use bob with npm scripts so that my scripts will be run from inside the example app, not the package folder. Also, I need to make sure the solution will continue to let the package run the postinstall scripts well even after releasing to npm.

Thank you!

teodorciuraru avatar Nov 16 '20 14:11 teodorciuraru

The postinstall script is executed by yarn/npm. Bob cannot change the current directory.

satya164 avatar Mar 03 '21 11:03 satya164