commitizen / commitizen/cz-cli

Monorepo precommit hook says "Not a git repository: '.git'"

Đang mở
#557 1 bình luận 0 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ả

I have a monorepo using Lerna. Here's the structure for my example:

```
my-monorepo/
package.json
packages/
my-package/
package.json
```

In `my-monorepo/packages/my-package/package.json`, I have a script: `"precommit": "yarn buildExports && git add ./exports"`.
In `my-monorepo/package.json` I have a script: `"precommit": "lerna run precommit"`.

When I run `yarn precommit` inside my package, it works correctly.
When I run `yarn precommit` in the root of my repo, it works correctly.
But when I run `yarn git-cz` and complete the flows to get it to trigger my precommit script, I get:

```
lerna ERR! Error: Command failed: yarn run precommit
lerna ERR! fatal: Not a git repository: '.git'
lerna ERR! error Command failed with exit code 128.
```

I have not been able to find anything in lerna or in cz-cli to help me with this. Any help would be greatly appreciated.

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.