Skip to content

Commit

Permalink
Ensure HTML is written to disk when outputMode=pretty. (GoogleChrome#846
Browse files Browse the repository at this point in the history
)

`outputMode` in this case is derived from the CLI options and ends up being a regular string.
Then it's being compared to an enum value, which in Typscript is a number by default.

This PR ensures that we compare string against string and correctly write the HTML output to disk.
  • Loading branch information
shakyShane authored and andrewrota committed Jan 13, 2017
1 parent 4bcc263 commit 653d462
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lighthouse-cli/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ function lighthouseRun(addresses: Array<string>, config: Object) {
return lighthouse(address, flags, config)
.then((results: Results) => Printer.write(results, outputMode, outputPath))
.then((results: Results) => {
if (outputMode === Printer.OutputMode.pretty) {
const filename = `./${assetSaver.getFilenamePrefix({url: address})}.report.html`
if (outputMode === Printer.OutputMode[Printer.OutputMode.pretty]) {
const filename = `./${assetSaver.getFilenamePrefix({url: address})}.report.html`;
Printer.write(results, 'html', filename);
}

Expand Down

0 comments on commit 653d462

Please sign in to comment.