Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --view flag. Don't default CLI report to stdout. #1764

Merged
merged 1 commit into from
Feb 24, 2017
Merged

Conversation

paulirish
Copy link
Member

First step in closing #1739 (Is it time to deprecate the CLI report output?)

  1. Adds a --view flag which will open the HTML report that the CLI generated in your default browser.
  2. Default output changes from pretty to none, which means you dont get the full report flooding your terminal at the end. You can re-enable it with --output=pretty, however.
  3. Log two little tips to stdout telling the CLI users about the change.

image

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay for bringing back --view! 🎉

@@ -269,8 +273,15 @@ function saveResults(results: Results,
promise = promise.then(_ => assetSaver.saveAssets(artifacts, results.audits, resolvedPath));
}

if (flags.output === Printer.OutputMode[Printer.OutputMode.pretty]) {
promise = promise.then(_ => Printer.write(results, 'html', `${resolvedPath}.report.html`));
if (flags.output === Printer.OutputMode[Printer.OutputMode.none]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunate that one cannot get both pretty output and HTML output now, but we're killing it entirely and #1714 captures multiple output desires anyway

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true.

@paulirish paulirish merged commit dbb32c9 into master Feb 24, 2017
@paulirish paulirish deleted the openinbrowser branch February 24, 2017 01:31
@XhmikosR
Copy link
Contributor

@paulirish: is it expected that now if output=pretty is specified, the report.html isn't being saved anymore?

@patrickhulce
Copy link
Collaborator

@XhmikosR yes that was a consequence of this change as noted in #1764 (comment)

@XhmikosR
Copy link
Contributor

Ah, I see thanks. Not a big deal, but took me a while to see why it stopped to work. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants