Skip to content

Commit

Permalink
fix: use sync file output
Browse files Browse the repository at this point in the history
  • Loading branch information
maxjeffos committed Mar 2, 2021
1 parent 1f6c90b commit 47d29a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ SnykToHtml.run(

function onReportOutput(report: string): void {
if (output) {
fs.writeFile(output, report, (err) => {
if (err) {
return console.log(err);
}
try {
fs.writeFileSync(output, report);
console.log('Vulnerability snapshot saved at ' + output);
});
} catch (err) {
return console.log(err);
}
} else {
console.log(report);
}
Expand Down

0 comments on commit 47d29a2

Please sign in to comment.