Skip to content

Commit

Permalink
chore: accept path for lint sarif report
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Mucha <[email protected]>
  • Loading branch information
drptbl committed Aug 30, 2022
1 parent 8db0870 commit ffa37c8
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,15 @@ const otherFormatter = cli.getFormatter(

console.log('Saving sarif report..');

fs.writeFile(
'lint-results.sarif',
otherFormatter(report.results),
'utf8',
() => {
console.log('Sarif report saved');
if (report.errorCount > 0) {
console.log('Errors found, exiting..');
process.exit(1);
} else {
console.log('No errors found');
process.exit(0);
}
},
);
const filePath = argv[4] ? argv[4] : 'lint-results.sarif';

fs.writeFile(filePath, otherFormatter(report.results), 'utf8', () => {
console.log('Sarif report saved');
if (report.errorCount > 0) {
console.log('Errors found, exiting..');
process.exit(1);
} else {
console.log('No errors found');
process.exit(0);
}
});

0 comments on commit ffa37c8

Please sign in to comment.