Skip to content

Commit

Permalink
fix: output reports relative to process path
Browse files Browse the repository at this point in the history
  • Loading branch information
TGiles authored Aug 18, 2019
1 parent 40cdb53 commit fce58ca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lighthouse_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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);
}
});
};
Expand Down Expand Up @@ -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 });
}
Expand Down

0 comments on commit fce58ca

Please sign in to comment.