Skip to content

Commit

Permalink
fix: missing promise awaits on output file write
Browse files Browse the repository at this point in the history
  • Loading branch information
treefitty authored and nonzzz committed Apr 12, 2024
1 parent d76f598 commit fbee7b2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,13 @@ function analyzer(opts: AnalyzerPluginOptions = { analyzerMode: 'server', summar
case 'json': {
const p = path.join(defaultWd, opts.fileName ? `${opts.fileName}.json` : 'stats.json')
const foamModule = analyzerModule.processFoamModule()
fsp.writeFile(p, JSON.stringify(foamModule, null, 2), 'utf8')
break
return fsp.writeFile(p, JSON.stringify(foamModule, null, 2), 'utf8')
}
case 'static': {
const p = path.join(defaultWd, opts.fileName ? `${opts.fileName}.html` : 'stats.html')
const foamModule = analyzerModule.processFoamModule()
const html = await renderView(foamModule, { title: reportTitle, mode: 'stat' })
fsp.writeFile(p, html, 'utf8')
break
return fsp.writeFile(p, html, 'utf8')
}
case 'server': {
const foamModule = analyzerModule.processFoamModule()
Expand Down

0 comments on commit fbee7b2

Please sign in to comment.