-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump commander from v2 to v12 #137
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,39 @@ | ||
#!/usr/bin/env node | ||
|
||
var VERSION = require("../package.json").version; | ||
var program = require("commander"); | ||
var { program } = require("commander"); | ||
var run = require("../lib/run"); | ||
|
||
program | ||
.version(VERSION) | ||
|
||
program | ||
.command("start") | ||
.description("Start Firefox") | ||
.option("-b, --binary <path>", "Path of Firefox binary to use.") | ||
.option("--binary-args <CMDARGS>", "Pass additional arguments into Firefox.") | ||
.option("-p, --profile <path>", "Path or name of Firefox profile to use.") | ||
.option("-v, --verbose", "More verbose logging to stdout.") | ||
.option("--new-instance", "Use a new instance") | ||
.option("--no-remote", "Do not allow remote calls") | ||
.option("--foreground", "Bring Firefox to the foreground") | ||
.option("-l, --listen <port>", "Start the debugger server on a specific port.") | ||
.option("-l, --listen <port>", "Start the debugger server on a specific port.", parseInt) | ||
.action(function(options) { | ||
const parsedOptions = { | ||
binary: options.binary || process.env.JPM_FIREFOX_BINARY || "firefox", | ||
profile: options.profile, | ||
"new-instance": !!options.newInstance ? true : false, | ||
"foreground": !!options.foreground ? true : false, | ||
"no-remote": !options.remote ? true : false, | ||
"binary-args": options.binaryArgs || "", | ||
"listen": options.listen || 6000 | ||
}; | ||
|
||
program | ||
.command("start") | ||
.description("Start Firefox") | ||
.action(function() { | ||
console.log(Object.keys(program)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test harness relied on I made two changes:
|
||
run({ | ||
binary: program.binary || process.env.JPM_FIREFOX_BINARY || "firefox", | ||
profile: program.profile, | ||
"new-instance": !!program.newInstance ? true : false, | ||
"foreground": !!program.foreground ? true : false, | ||
"no-remote": !program.remote ? true : false, | ||
"binary-args": program.binaryArgs || "", | ||
"listen": program.listen || 6000 | ||
}) | ||
if (process.env.TESTING_FX_RUNNER) { | ||
console.log(JSON.stringify(parsedOptions)); | ||
} | ||
|
||
run(parsedOptions) | ||
.then(function(results) { | ||
var firefox = results.process; | ||
if (program.verbose) { | ||
|
@@ -37,4 +42,4 @@ program | |
}, console.exception); | ||
}); | ||
|
||
program.parse(process.argv); | ||
program.parse(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.option() must now follow .command()