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

Do not install husky git hooks when building a release tarball #72

Closed
tilgovi opened this issue Apr 3, 2020 · 0 comments · Fixed by #76
Closed

Do not install husky git hooks when building a release tarball #72

tilgovi opened this issue Apr 3, 2020 · 0 comments · Fixed by #76

Comments

@tilgovi
Copy link
Contributor

tilgovi commented Apr 3, 2020

I just discovered that husky will install its git hooks at the nearest git repository. I keep my dotfiles in git and was surprised to find husky hooks in my ~/.git/hooks directory, from when I was testing an Annotator release.

Here's my comment on a husky issue:

I'd like to use husky in a project that will be distributed as a tarball. I don't want husky to install hooks when users build the project.

Would it be possible to default to the old behavior of assuming that the git directory is at the same level as package.json, install no hooks if it's not found, and add a configuration switch for setting an explicit root? That would make the default safer while allowing those with different layouts the ability to still use husky.

typicode/husky#36 (comment)

I think we need to resolve this before release because I really don't want to install hooks into unknowable locations on users' machines.

tilgovi added a commit that referenced this issue May 5, 2020
Create a distribution by creating a shallow git clone.

Distributing a shallow clone has several befenits:

  - Join upstream development with `git fetch --unshallow`

  - Husky install is contained (close #72)

  - The distribution can reproduce itself
tilgovi added a commit that referenced this issue May 5, 2020
Create distribution tarballs by creating a shallow git clone.

Distributing a shallow clone has several befenits:

  - Join upstream development with `git fetch --unshallow`

  - Husky install is contained (close #72)

  - The distribution can reproduce itself
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

Successfully merging a pull request may close this issue.

1 participant