(command: str)
| 39 | |
| 40 | |
| 41 | def 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 | |
| 69 | def build_terminal_shell_launch(script_path: Path) -> ShellLaunchSpec: |
no test coverage detected