core(asset-saver): minor fix for logAssets (#4088)
This commit is contained in:
Родитель
9fa36ceaf2
Коммит
6ca5ef206e
|
@ -208,13 +208,13 @@ function saveAssets(artifacts, audits, pathWithBasename) {
|
|||
function logAssets(artifacts, audits) {
|
||||
return prepareAssets(artifacts, audits).then(assets => {
|
||||
assets.map(data => {
|
||||
log.log('devtoolslog-${data.passName}.json', data.devtoolsLog);
|
||||
log.log(`devtoolslog-${data.passName}.json`, data.devtoolsLog);
|
||||
const traceIter = traceJsonGenerator(data.traceData);
|
||||
let traceJson = '';
|
||||
for (const trace of traceIter) {
|
||||
traceJson += trace;
|
||||
}
|
||||
log.log('trace-${data.passName}.json', traceJson);
|
||||
log.log(`trace-${data.passName}.json`, traceJson);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -160,8 +160,8 @@ window.runLighthouseAsInCLI = function(connection, url, options, categoryIDs) {
|
|||
if (options && options.logAssets) {
|
||||
promise = promise.then(_ => assetSaver.logAssets(results.artifacts, results.audits));
|
||||
}
|
||||
filterOutArtifacts(results);
|
||||
return promise.then( _ => {
|
||||
filterOutArtifacts(results);
|
||||
const json = options && options.outputFormat === 'json';
|
||||
return json ? JSON.stringify(results) : new ReportGeneratorV2().generateReportHtml(results);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче