Skip to content

Commit

Permalink
when running from cli, merge cli flags with those found in config file.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehenrty committed May 30, 2020
1 parent f8a784f commit b80ffd0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ const cliFlags = yargs
.epilogue('For more Lighthouse CLI options see https://github.com/GoogleChrome/lighthouse/#lighthouse-cli-options')
.argv;

// Merge options from all sources. Order indicates precedence (last one wins)
const options = Object.assign({}, {flags: cliFlags}, config);
const options = config || {};

// Merge flags from CLI and config file (if present). Config flags take precedence.
options.flags = Object.assign({}, cliFlags, options.flags);

// Get url first from cmd line then from config file.
options.url = cliFlags._[0] || options.url;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"mocha": "^3.2.0",
"sinon": "^1.17.7",
"sinon-chai": "^2.8.0",
"typescript": "3.0.1"
"typescript": "3.5.1"
},
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4002,10 +4002,10 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=

typescript@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.1.tgz#43738f29585d3a87575520a4b93ab6026ef11fdb"
integrity sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==
typescript@3.5.1:
version "3.5.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.1.tgz#ba72a6a600b2158139c5dd8850f700e231464202"
integrity sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==

ultron@~1.1.0:
version "1.1.1"
Expand Down

0 comments on commit b80ffd0

Please sign in to comment.