Skip to content

Commit d43d8f9

Browse files
TheKangarooescapedcat
authored andcommitted
docs: let husky create commit hook conventional-changelog#3371 (conventional-changelog#3372)
1 parent db39c57 commit d43d8f9

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

README.md

+1-12
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,8 @@ yarn husky install
108108

109109
### Add hook
110110

111-
```sh
112-
echo '
113-
#!/bin/sh
114-
. "\$(dirname "\$0")/_/husky.sh"
115-
116-
npx --no -- commitlint --edit ${1}
117-
' > .husky/commit-msg
118111
```
119-
120-
Make hook executable
121-
122-
```sh
123-
chmod a+x .husky/commit-msg
112+
npx husky add .husky/commit-msg "npx --no -- commitlint --edit ${1}"
124113
```
125114

126115
Check the [husky documentation](https://typicode.github.io/husky/#/?id=manual) on how you can automatically have Git hooks enabled after install for different `yarn` versions.

docs/guides-local-setup.md

+1-12
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,8 @@ yarn husky install
3939

4040
### Add hook
4141

42-
```sh
43-
echo '
44-
#!/bin/sh
45-
. "\$(dirname "\$0")/_/husky.sh"
46-
47-
npx --no -- commitlint --edit ${1}
48-
' > .husky/commit-msg
4942
```
50-
51-
Make hook executable
52-
53-
```sh
54-
chmod a+x .husky/commit-msg
43+
npx husky add .husky/commit-msg "npx --no -- commitlint --edit ${1}"
5544
```
5645

5746
**Please note that currently @commitlint/cli doesn't support yarn v2 Plug'n'Play (using yarn v2 with `nodeLinker: node-modules` in your .yarnrc.yml file may work sometimes)**\

0 commit comments

Comments
 (0)