diff --git a/docs/README.md b/docs/README.md index 29a84464c..a96fb3f72 100644 --- a/docs/README.md +++ b/docs/README.md @@ -246,9 +246,9 @@ For Git commands that don't have a `--no-verify` option, you can use `HUSKY` env HUSKY=0 git push # yolo! ``` -## Disable husky in CI/Docker +## Disable husky in CI/Docker/Prod -There's no right or wrong way to disable husky in CI/Docker context and is highly __dependent on your use-case__. +There's no right or wrong way to disable husky in CI/Docker/Prod context and is highly __dependent on your use-case__. ### With npm @@ -281,6 +281,12 @@ if (!isCi) { } ``` +Or make `prepare` script fail silently if husky is not installed: + +```json +"prepare": "node -e \"try { require('husky').install() } catch (e) {if (e.code !== 'MODULE_NOT_FOUND') throw e}\"' +``` + ### With env variables You can set `HUSKY` environment variable to `0` in your CI config file, to disable all hooks.