Skip to content

Commit

Permalink
docs: update Docker section
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Jul 6, 2021
1 parent 8c7d015 commit 50ea409
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ HUSKY=0 git push # yolo!

## Disable husky in CI/Docker

There's no right or wrong way to disable husky in CI/Docker context and it's highly dependent on your use-case.
There's no right or wrong way to disable husky in CI/Docker context and is highly __dependent on your use-case__.

### With npm

Expand All @@ -261,6 +261,22 @@ npm set-script prepare ""
npm ci --only-production
```

### With a custom script

You can create a custom JS script and conditionally require husky and install hooks.

```json
"prepare": "node ./prepare.js"
```

```js
// prepare.js
const someConditions = process.env.CI !== undefined
if (someConditions) {
require('husky').install()
}
```

### 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 50ea409

Please sign in to comment.