Skip to content

Commit 9bc56c6

Browse files
committed
fix(travis-cli): read push commits directly
1 parent da23140 commit 9bc56c6

File tree

1 file changed

+14
-2
lines changed
  • @commitlint/travis-cli/src

1 file changed

+14
-2
lines changed

@commitlint/travis-cli/src/cli.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ async function main() {
4747
const [start, end] = RANGE.split('.').filter(Boolean);
4848
await lint(['--from', start, '--to', end]);
4949
} else {
50-
await lint(['--from', COMMIT]);
50+
const input = await log(COMMIT);
51+
await lint([], {input});
5152
}
5253
}
5354

@@ -71,10 +72,21 @@ async function lint(args, options) {
7172
return execa(
7273
COMMITLINT || commitlint,
7374
args,
74-
Object.assign({}, {stdio: 'inherit'}, options)
75+
Object.assign({}, {stdio: ['pipe', 'inherit', 'inherit']}, options)
7576
);
7677
}
7778

79+
async function log(hash) {
80+
const result = await execa('git', [
81+
'log',
82+
'-n',
83+
'1',
84+
'--pretty=format:%B',
85+
hash
86+
]);
87+
return result.stdout;
88+
}
89+
7890
async function stash() {
7991
if (await isClean()) {
8092
return async () => {};

0 commit comments

Comments
 (0)