Skip to content

Commit

Permalink
fix(cli): avoid linebreak in empty input
Browse files Browse the repository at this point in the history
  • Loading branch information
escapedcat committed Dec 19, 2018
1 parent e23839c commit b81c895
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions @commitlint/cli/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ async function main(options) {
const input = await (fromStdin ? stdin() : read(range, {cwd: flags.cwd}));

const messages = (Array.isArray(input) ? input : [input])
.filter(message => message.trim() !== '')
.filter(message => typeof message === 'string')
.filter(Boolean);

Expand Down

0 comments on commit b81c895

Please sign in to comment.