Skip to content

Commit

Permalink
Add --warn option to exit with code 0
Browse files Browse the repository at this point in the history
  • Loading branch information
olore authored and thedaviddias committed Aug 23, 2018
1 parent 4e6be87 commit 24fb1cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/htmlhint
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ program
.option('-f, --format <'+arrSupportedFormatters.join('|')+'>', 'output messages as custom format')
.option('-i, --ignore <pattern, pattern ...>', 'add pattern to exclude matches')
.option('--nocolor', 'disable color')
.option('--warn', 'Warn only, exit with 0')
.parse(process.argv);

if(program.list){
Expand Down Expand Up @@ -134,7 +135,7 @@ function hintTargets(arrTargets, options){
allHintCount: allHintCount,
time: spendTime
});
process.exit(allHintCount > 0 ? 1: 0);
process.exit(!program.warn && allHintCount > 0 ? 1 : 0);
});
}

Expand Down

0 comments on commit 24fb1cd

Please sign in to comment.