Skip to content

[QUESTION] Recommended approach for setting up postinstall script #39

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
gabrieljablonski opened this issue May 15, 2025 · 0 comments

Comments

@gabrieljablonski
Copy link

gabrieljablonski commented May 15, 2025

Opening a regular issue since the Discussions tab does not seem to be setup for this repo.

First of all, thanks for working on this project. Stumbled on this repo a few weeks ago, and it likely will be a staple for my bun projects going forward.

Now for the actual question.


I see you guys provide a postinstall script that (I think?) does the equivalent of running bun git-hooks to setup the hooks.

But that seems to only be relevant for development environment, since that file isn't included in the published package bundle.

I tried creating my own postinstall script to run bun git-hooks "manually" on my repo, but I stumbled on another issue that the script is run on production environment as well (where bun-git-hooks isn't installed), which fails.

My currrent solution (which I haven't tested yet, but I think will work fine) is to update this postinstall on my repo to check NODE_ENV before running bun git-hooks. But that feels a bit hacky, so I'm wondering if you guys have any other standard ways of doing this.

(Not super relevant, but here's my repo config for reference just in case.)

Thanks again for working on this, looking great!

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

1 participant