From fce58ca181325105b768cc2e75d500303ed2e01a Mon Sep 17 00:00:00 2001 From: Tim Giles Jr <6314039+TGiles@users.noreply.github.com> Date: Sun, 18 Aug 2019 00:00:03 -0400 Subject: [PATCH] fix: output reports relative to process path --- lighthouse_runner.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lighthouse_runner.js b/lighthouse_runner.js index 60521db..1011751 100644 --- a/lighthouse_runner.js +++ b/lighthouse_runner.js @@ -8,7 +8,6 @@ const { URL } = require('url'); const open = require('open'); let autoOpen = false; let port; - const simpleCrawlerConfig = require('./config/simpleCrawler'); const runnerConfig = require('./config/runnerConfiguration'); @@ -100,9 +99,9 @@ const processResults = (processObj) => { }, (err) => { if (err) throw err; if (opts.emulatedFormFactor && opts.emulatedFormFactor === 'desktop') { - console.log('Wrote desktop report: ', currentUrl) + console.log('Wrote desktop report: ', currentUrl, 'at: ', tempFilePath); } else { - console.log('Wrote mobile report: ', currentUrl); + console.log('Wrote mobile report: ', currentUrl, 'at: ', tempFilePath); } }); }; @@ -158,7 +157,7 @@ const complete = (urlList) => { fileTime = fileTime.replace(/,/g, '_'); fileTime = fileTime.replace(/:/g, "_"); // tempFilePath is wherever we want to store the generated report - let tempFilePath = path.join(__dirname, "lighthouse", fileTime); + let tempFilePath = path.join(process.cwd(), "lighthouse", fileTime); if (!fs.existsSync(tempFilePath)) { fs.mkdirSync(tempFilePath, { recursive: true }); }