-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: fix example * add log
- Loading branch information
Showing
1 changed file
with
4 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,14 +68,13 @@ Modify the `prepare` script to never fail: | |
|
||
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`: | ||
|
||
<!-- Since husky may not be installed, it must be imported dynamically after prod/CI check --> | ||
```js | ||
// Skip Husky install in production and CI | ||
import husky from 'husky' | ||
if (process.env.NODE_ENV === 'production' || process.env.CI === '1') { | ||
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') { | ||
process.exit(0) | ||
} | ||
const husky = (await import('husky')).default | ||
console.log(husky()) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
typicode
Author
Owner
|
||
``` | ||
|
||
|
@@ -190,7 +189,7 @@ Alternatively, if your shell startup file is fast and lightweight, source it dir | |
|
||
## Manual setup | ||
|
||
Git needs to be configured and husky needs to setup files in `.husky/`. | ||
Git needs to be configured and husky needs to setup files in `.husky/`. | ||
|
||
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). | ||
|
||
|
@typicode: Why using console.log() on the husky() function return?