Skip to content

Commit db3f2bd

Browse files
committed
fix(scripts/commit): strip rogue commit arg coming from yarn commit
For some reason invoking this script with `yarn commit` now passes through `'commit'` in the arguments that get parsed as "raw git arguments" in the adapter which blows up said parsing behavior. I'm not sure if this was related to a yarn change (`yarn [script] args` vs. `yarn [script] -- args`) or something else... Either way, this is a band-aid to filter out the rogue argument for now.
1 parent b426df3 commit db3f2bd

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

src/scripts/commit.js

+18-5
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,22 @@ const cliPath = [
1010
fromRoot('./node_modules/commitizen'),
1111
].find(fs.existsSync)
1212

13-
bootstrap({
14-
cliPath,
15-
config: {
16-
path: '@commitlint/prompt',
13+
// eslint-disable-next-line no-warning-comments
14+
// FIXME: for some reason invoking this script with `yarn commit` now passes
15+
// through `'commit'` in the arguments that get parsed as "raw git arguments"
16+
// in the adapter which blows up said parsing behavior. I'm not sure if this
17+
// was related to a yarn change (`yarn [script] args` vs. `yarn [script] --
18+
// args`) or something else...
19+
//
20+
// Either way, this is a band-aid to filter out the rogue argument for now.
21+
const args = process.argv.filter(arg => arg !== 'commit')
22+
23+
bootstrap(
24+
{
25+
cliPath,
26+
config: {
27+
path: '@commitlint/prompt',
28+
},
1729
},
18-
})
30+
args,
31+
)

0 commit comments

Comments
 (0)