Skip to content

Commit

Permalink
docs: add another way to disable husky in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Feb 20, 2022
1 parent 5d269e8 commit 222b1de
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/README.md
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 222b1de

Please sign in to comment.