commitizen / commitizen/cz-cli

husky hook does not work

オープン
#981 コメント 4 件 リアクション 3 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
17.5k
フォーク
566
平均マージ
8時間 16分
マージ済み PR(30日)
1

説明

[This part of README](https://github.com/commitizen/cz-cli?tab=readme-ov-file#husky) has this:
```json
"husky": {
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && npx cz --hook || true"
}
}
```
But this hook does not work. When I use `git commit` - I get default behavior

If I put this in .husky/prepare-commit-msg:
```sh
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

exec < /dev/tty && npx cz --hook || true

```
And run `git commit` it works but after commitizen I see result commit in nano. How to fix this?
![image](https://github.com/commitizen/cz-cli/assets/66206278/b399e87b-c91f-4e45-8581-27ec3f7e4ccc)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。