commitizen / commitizen/cz-cli

Can I pass the adapter config from node but not read from then package.json

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

Hi, thanks you for the great work.
I am trying write a new command to call the `cz-cli` like the [doc](https://github.com/commitizen/cz-cli#commitizen-for-multi-repo-projects) said.
However, I will get some error as below when I run the command if the `pakcage.json` does not have the `config` propery.
```
\node_modules\commitizen\node_modules\cz-conventional-changelog\index.js:10
defaultType: process.env.CZ_TYPE || config.defaultType,
^
TypeError: Cannot read property 'defaultType' of undefined

```
I want the user can just run a commit command and do not need to add package.json config. Is that possible?Someways like:
```
const bootstrap = require('commitizen/dist/cli/git-cz').bootstrap
const path = require('path')
bootstrap({
cliPath: path.join(__dirname, '../node_modules/commitizen'),
config: {
"path": 'cz-conventional-changelog'
},
adapter: {
"commitizen": {
"path": "cz-conventional-changelog"
}
}
})
```

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.