diff --git a/bin/sitespeed.js b/bin/sitespeed.js index 94ae48376..88b19191f 100755 --- a/bin/sitespeed.js +++ b/bin/sitespeed.js @@ -4,6 +4,7 @@ 'use strict'; +const fs = require('fs'); const cli = require('../lib/cli/cli'); const sitespeed = require('../lib/sitespeed'); @@ -15,6 +16,10 @@ async function run(options) { throw new Error('Errors while running:\n' + result.errors.join('\n')); } + if (options.storeResult) { + fs.writeFileSync('result.json', JSON.stringify(result)); + } + if ( parsed.options.budget && Object.keys(result.budgetResult.failing).length > 0