- Notifications
You must be signed in to change notification settings - Fork 950
Closed
Labels
Description
Bug only happens after recent update (from @commitlint/cli@7.5.2 to @commitlint/cli@7.6.0).
Before update: absolute paths to --config was treated properly (as absolute paths).
After update: absolute path in --config is treated as relative, so process.cwd() gets prepended to it and path becomes invalid, with error like this:
commitlint --config /Users/kirill/Idea/js-lib/node_modules/@naturalcycles/dev-lib/cfg/commitlint.config.js /Users/kirill/Idea/js-lib/node_modules/@commitlint/cli/lib/cli.js:114 throw err; ^ Error: ENOENT: no such file or directory, open '/Users/kirill/Idea/js-lib/Users/kirill/Idea/js-lib/node_modules/@naturalcycles/dev-lib/cfg/commitlint.config.js' I was running it from cwd of /Users/kirill/Idea/js-lib (as seen in the log above).
Affected packages
- cli
- core
- prompt
- config-angular
Steps to Reproduce (for bugs)
commitlint --config /Users/user/commitlist.config.js- See that it resolved wrongly, like:
Error: ENOENT: no such file or directory, open '/Users/kirill/Idea/js-lib/Users/kirill/Idea/js-lib/node_modules/@naturalcycles/dev-lib/cfg/commitlint.config.js' Your Environment
| Executable | Version |
|---|---|
commitlint --version | VERSION |
7.6.0 | |
git --version | VERSION |
git version 2.20.1 (Apple Git-117) | |
node --version | VERSION |
v10.15.3 |