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

cli: enableErrorReporting must be undefined by default #5854

Merged
merged 2 commits into from
Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lighthouse-cli/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ if (cliFlags.extraHeaders) {
function run() {
return Promise.resolve()
.then(_ => {
// By default, cliFlags.enableErrorReporting is undefined so the user is
// prompted. This can be overriden with an explicit flag or by the cached
// answer returned by askPermission().
Copy link
Member

Choose a reason for hiding this comment

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

🅼🆅🅿

if (typeof cliFlags.enableErrorReporting === 'undefined') {
return askPermission().then(answer => {
cliFlags.enableErrorReporting = answer;
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-cli/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function getFlags(manualArgv) {
// boolean values
.boolean([
'disable-storage-reset', 'disable-device-emulation', 'save-assets', 'list-all-audits',
'list-trace-categories', 'view', 'verbose', 'quiet', 'help', 'enable-error-reporting',
'list-trace-categories', 'view', 'verbose', 'quiet', 'help',
])
.choices('output', printer.getValidOutputOptions())
.choices('throttling-method', ['devtools', 'provided', 'simulate'])
Expand All @@ -136,6 +136,7 @@ function getFlags(manualArgv) {
.default('output', ['html'])
.default('port', 0)
.default('hostname', 'localhost')
.default('enable-error-reporting', undefined) // Undefined so prompted by default
.check(/** @param {LH.CliFlags} argv */ (argv) => {
// Lighthouse doesn't need a URL if...
// - We're in auditMode (and we have artifacts already)
Expand Down
2 changes: 1 addition & 1 deletion typings/externs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ declare global {
outputPath: string;
saveAssets: boolean;
view: boolean;
enableErrorReporting: boolean;
enableErrorReporting?: boolean;
listAllAudits: boolean;
listTraceCategories: boolean;
preset?: 'full'|'mixed-content'|'perf';
Expand Down