Skip to content

Commit

Permalink
assetsaver. write real traces to disk.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Aug 19, 2016
1 parent 02dfba2 commit 034e9a6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lighthouse-core/lib/asset-saver.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,11 @@ function prepareAssets(options, artifacts) {
function saveAssets(options, artifacts) {
const assets = prepareAssets(options, artifacts);

const traceFilename = getFilenamePrefix(options);
fs.writeFileSync(traceFilename + '.trace.json', stringify(assets.traceData, null, 2));
log.log('trace file saved to disk', traceFilename);
assets.traceData.forEach((data, index) => {
const traceFilename = getFilenamePrefix(options);
fs.writeFileSync(`${traceFilename}${index}.trace.json`, stringify(data, null, 2));
log.log('trace file saved to disk', traceFilename);
});

const screenshotsFilename = getFilenamePrefix(options);
fs.writeFileSync(screenshotsFilename + '.screenshots.html', assets.html);
Expand Down

0 comments on commit 034e9a6

Please sign in to comment.