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

env variable to prevent install #172

Closed
noamokman opened this issue Aug 25, 2017 · 3 comments · Fixed by #178
Closed

env variable to prevent install #172

noamokman opened this issue Aug 25, 2017 · 3 comments · Fixed by #178

Comments

@noamokman
Copy link
Contributor

Hi,
Can we add an env variable to disable the install script?
something like the CI detection.

Let me know if I should open a PR.
Thanks

@typicode
Copy link
Owner

Hi @noamokman,

What's your use case? Or what issues are you facing?

Alternatively, depending on your use case one of these solutions may work:

  • you can use npm install --ignore-scripts but it will ignore all postinstall scripts
  • you can only install dependencies and not devDependencies which would prevent install

@noamokman
Copy link
Contributor Author

Yeah,
I use husky on 2 generator project,
A part of the test it to run npm install on an inner folder.
The generated folder then installs husky on a folder with out a .git directory, so it traverses up to the git folder of the generator, this breaks existing hooks.

Adding a new environment variable should be quit simple.
Would be happy to do it for you.

Maybe SKIP_HUSKY_INSTALL.

Thanks!

@typicode
Copy link
Owner

After giving some thoughts, PR welcome :)

Seems like there was something that was started to control installation:
https://github.com/typicode/husky/blob/master/bin/install.js#L10

HUSKY_IGNORE_CI could be refactored to HUSKY_SKIP_INSTALL

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.

2 participants