From b44b1749ab5ed981c4d329fcfce8d59f77b87428 Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Thu, 11 May 2017 14:46:10 -0700 Subject: [PATCH] plots: tell user first run is being discarded (#2232) also fix eslint ignores --- plots/measure.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plots/measure.js b/plots/measure.js index dfe298bc43cd..7b14463bc5fb 100644 --- a/plots/measure.js +++ b/plots/measure.js @@ -16,6 +16,8 @@ */ 'use strict'; +/* eslint-disable no-console */ + const path = require('path'); const parseURL = require('url').parse; @@ -125,8 +127,8 @@ const URLS = [ */ function main() { if (utils.isDir(constants.OUT_PATH)) { - console.log('ERROR: Found output from previous run at: ', constants.OUT_PATH); // eslint-disable-line no-console - console.log('Please run: npm run clean'); // eslint-disable-line no-console + console.log('ERROR: Found output from previous run at: ', constants.OUT_PATH); + console.log('Please run: npm run clean'); return; } @@ -140,7 +142,7 @@ function main() { () => { throw err; }, - console.error // eslint-disable-line no-console + console.error )); } @@ -177,7 +179,7 @@ function runAnalysis() { * @return {!Promise} */ function singleRunAnalysis(url, id, {ignoreRun}) { - console.log('Measuring site:', url, 'run:', id); // eslint-disable-line no-console + console.log('Measuring site:', url, 'run:', id); const parsedURL = parseURL(url); const urlBasedFilename = sanitizeURL(`${parsedURL.host}-${parsedURL.pathname}`); const runPath = path.resolve(constants.OUT_PATH, urlBasedFilename, id); @@ -203,6 +205,7 @@ function analyzeWithLighthouse(url, outputPath, assetsPath, {ignoreRun}) { return lighthouse(url, flags, config) .then(lighthouseResults => { if (ignoreRun) { + console.log('First load of site. Results not being saved to disk.'); return; } return assetSaver @@ -212,7 +215,7 @@ function analyzeWithLighthouse(url, outputPath, assetsPath, {ignoreRun}) { return Printer.write(lighthouseResults, flags.output, outputPath); }); }) - .catch(err => console.error(err)); // eslint-disable-line no-console + .catch(err => console.error(err)); } /**