Bug 1936278 - Prevent search mode chiclet from being dismissed when clicking in page...
[gecko.git] / js / xpconnect / mach_commands.py
blob68cf3844c37aa5689b993d1457cf9e1a7b4b8a0a
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 import argparse
6 import sys
7 from pathlib import Path
9 from mach.decorators import Command, CommandArgument
12 @Command("xpcshell", category="misc", description="Run the xpcshell binary")
13 @CommandArgument(
14 "args", nargs=argparse.REMAINDER, help="Arguments to provide to xpcshell"
16 def xpcshell(command_context, args):
17 dist_bin = Path(command_context.topobjdir, "dist", "bin")
18 browser_dir = dist_bin / "browser"
20 if sys.platform == "win32":
21 xpcshell = dist_bin / "xpcshell.exe"
22 else:
23 xpcshell = dist_bin / "xpcshell"
25 command = [
26 str(xpcshell),
27 "-g",
28 str(dist_bin),
29 "-a",
30 str(browser_dir),
33 # Disable the socket process (see https://bugzilla.mozilla.org/show_bug.cgi?id=1903631).
34 env = {
35 "MOZ_DISABLE_SOCKET_PROCESS": "1",
38 if args:
39 command.extend(args)
41 return command_context.run_process(
42 command,
43 pass_thru=True,
44 ensure_exit_code=False,
45 append_env=env,