commitizen / commitizen/cz-cli

husky hook does not work

Đang mở
#981 4 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
17.5k
Fork
566
Merge trung bình
8 giờ 16 phút
Pull request đã merge (30 ngày)
1

Mô tả

[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)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.