Skip to content

Commit

Permalink
feat(CLI): add --no-sandbox as alias to --disable-sandbox (#4722)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi committed Jun 4, 2024
1 parent df9bb43 commit cd9a684
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tools/respec2html.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,12 @@ cli
"Abort if ReSpec generates warnings (or errors).",
false
)
.option("--disable-sandbox", "Disable Chromium sandboxing if needed.", false)
.option(
"--sandbox",
"Disable Chromium sandboxing if needed, with --no-sandbox.",
true
)
.option("--disable-sandbox", "Alias of --no-sandbox.", false)
.option("--devtools", "Enable debugging and show Chrome's DevTools.", false)
.option("--verbose", "Log processing status to stdout.", false)
.option("--localhost", "Spin up a local server to perform processing.", false)
Expand All @@ -201,6 +206,11 @@ cli.action(async (source, destination, opts) => {
process.exit(1);
}

if (opts["disable-sandbox"]) {
opts.sandbox = false;
delete opts["disable-sandbox"];
}

try {
await run(source, destination, opts, log);
process.exit(0);
Expand Down Expand Up @@ -247,7 +257,7 @@ async function run(source, destination, options, log) {
onError: log.error.bind(log),
onWarning: log.warn.bind(log),
onProgress: log.info.bind(log),
disableSandbox: options["disable-sandbox"],
disableSandbox: !options.sandbox,
devtools: options.devtools,
});

Expand Down

0 comments on commit cd9a684

Please sign in to comment.