Skip to content

Commit 462c5e7

Browse files
committed
fix(scripts/commit): find commitizen relative to parent project as well
1 parent 9a2808e commit 462c5e7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/scripts/commit.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
const fs = require('fs')
12
const path = require('path')
23
const {bootstrap} = require('commitizen/dist/cli/git-cz')
4+
const {fromRoot} = require('../utils')
35

46
const here = p => path.join(__dirname, p)
57

8+
const cliPath = [
9+
here('../../node_modules/commitizen'),
10+
fromRoot('./node_modules/commitizen'),
11+
].find(fs.existsSync)
12+
613
bootstrap({
7-
cliPath: here('../../node_modules/commitizen'),
14+
cliPath,
815
config: {
916
path: '@commitlint/prompt',
1017
},

0 commit comments

Comments
 (0)