Skip to content

Commit 2e283a3

Browse files
faceyspaceyjimthedev
authored andcommitted
docs($readme): add note about avoiding double calls to precommit (#433)
1 parent d5e2424 commit 2e283a3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ And you can then add some nice npm run scripts in your package.json pointing to
113113

114114
This will be more convenient for your users because then if they want to do a commit, all they need to do is run `npm run commit` and they will get the prompts needed to start a commit!
115115

116+
> **NOTE:** if you are using `precommit` hooks thanks to something like `husky`, you will need to name your script some thing other than "commit" (e.g. "cm": "git-cz"). The reason is because npm-scripts has a "feature" where it automatically runs scripts with the name *prexxx* where *xxx* is the name of another script. In essence, npm and husky will run "precommit" scripts twice if you name the script "commit," and the work around is to prevent the npm-triggered *precommit* script.
117+
116118
#### Congratulations your repo is Commitizen-friendly. Time to flaunt it!
117119

118120
Add the Commitizen-friendly badge to your README using the following markdown:

0 commit comments

Comments
 (0)