Skip to content

Commit

Permalink
fix launcher w/ arbitrary flags (#2670)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish authored Jul 11, 2017
1 parent 78e761a commit 8c9724e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chrome-launcher/manual-chrome-launcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
*/

require('./compiled-check.js')('chrome-launcher.js');
const {launch} = require('./chrome-launcher');

const args = process.argv.slice(2);

let chromeFlags;
let startingUrl;
let port;

if (args.length) {
chromeFlags = args.filter(flag => flag.startsWith('--'));
port = chromeFlags.find(flag => flag.startsWith('--port=')).replace('--port=', '');

const portFlag = chromeFlags.find(flag => flag.startsWith('--port='));
port = portFlag && portFlag.replace('--port=', '');

startingUrl = args.find(flag => !flag.startsWith('--'));
}

const {launch} = require('./chrome-launcher');

launch({
startingUrl,
port,
Expand Down

0 comments on commit 8c9724e

Please sign in to comment.