diff --git a/lighthouse-cli/bin.js b/lighthouse-cli/bin.js index 1cafc139ccb0..40ff47b308a0 100644 --- a/lighthouse-cli/bin.js +++ b/lighthouse-cli/bin.js @@ -8,6 +8,19 @@ const fs = require('fs'); const path = require('path'); +/* + * The relationship between these CLI modules: + * + * index.js : only calls bin.js's begin() + * cli-flags.js : leverages yargs to read argv, outputs LH.CliFlags + * bin.js : CLI args processing. cwd, list/print commands + * run.js : chrome-launcher bits, calling lighthouse-core, output to Printer + * + * index ----> bin ----> run ----> printer + * ⭏ ⭎ ⭏ ⭎ + * cli-flags lh-core/index + */ + const commands = require('./commands/commands.js'); const printer = require('./printer.js'); const getFlags = require('./cli-flags.js').getFlags; @@ -95,7 +108,7 @@ if (cliFlags.extraHeaders) { /** * @return {Promise} */ -async function run() { +async function begin() { if (cliFlags.printConfig) { const config = generateConfig(configJson, cliFlags); process.stdout.write(config.getPrintString()); @@ -127,5 +140,5 @@ async function run() { } module.exports = { - run, + begin, }; diff --git a/lighthouse-cli/index.js b/lighthouse-cli/index.js index 2f82152ed87c..38b30f8a1527 100755 --- a/lighthouse-cli/index.js +++ b/lighthouse-cli/index.js @@ -6,4 +6,4 @@ */ 'use strict'; -require('./bin.js').run(); +require('./bin.js').begin();