MCPcopy Create free account
hub / github.com/ResearAI/DeepScientist / build_exec_shell_launch

Function build_exec_shell_launch

src/deepscientist/bash_exec/shells.py:41–66  ·  view source on GitHub ↗
(command: str)

Source from the content-addressed store, hash-verified

39
40
41def build_exec_shell_launch(command: str) -> ShellLaunchSpec:
42 normalized = str(command or "").strip()
43 if os.name != "nt":
44 return ShellLaunchSpec(
45 argv=["bash", "-lc", normalized],
46 family="bash",
47 shell_name="bash",
48 )
49 binary, family = _resolve_windows_shell(interactive=False)
50 if family == "bash":
51 return ShellLaunchSpec(
52 argv=[binary, "-lc", normalized],
53 family=family,
54 shell_name=Path(binary).name,
55 )
56 if family == "cmd":
57 return ShellLaunchSpec(
58 argv=[binary, "/d", "/s", "/c", normalized],
59 family=family,
60 shell_name=Path(binary).name,
61 )
62 return ShellLaunchSpec(
63 argv=[binary, "-NoLogo", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", normalized],
64 family=family,
65 shell_name=Path(binary).name,
66 )
67
68
69def build_terminal_shell_launch(script_path: Path) -> ShellLaunchSpec:

Callers 3

_check_shell_backendFunction · 0.85
run_monitorFunction · 0.85
start_sessionMethod · 0.85

Calls 2

ShellLaunchSpecClass · 0.85
_resolve_windows_shellFunction · 0.85

Tested by

no test coverage detected