Skip to content

Commit 800fbf1

Browse files
authored
docs: fix example (#1363)
* docs: fix example * add log
1 parent c1bbd9b commit 800fbf1

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

docs/how-to.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,13 @@ Modify the `prepare` script to never fail:
6868

6969
You'll still get a `command not found` error message in your output which may be confusing. To make it silent, create `.husky/install.mjs`:
7070

71+
<!-- Since husky may not be installed, it must be imported dynamically after prod/CI check -->
7172
```js
7273
// Skip Husky install in production and CI
73-
import husky from 'husky'
74-
75-
if (process.env.NODE_ENV === 'production' || process.env.CI === '1') {
74+
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
7675
process.exit(0)
7776
}
78-
77+
const husky = (await import('husky')).default
7978
console.log(husky())
8079
```
8180

@@ -190,7 +189,7 @@ Alternatively, if your shell startup file is fast and lightweight, source it dir
190189

191190
## Manual setup
192191

193-
Git needs to be configured and husky needs to setup files in `.husky/`.
192+
Git needs to be configured and husky needs to setup files in `.husky/`.
194193

195194
Run the `husky` command once in your repo. Ideally, include it in the `prepare` script in `package.json` for automatic execution after each install (recommended).
196195

0 commit comments

Comments
 (0)