(command: Iterable[str], *, capture_output: bool = False, check: bool = True)
| 81 | |
| 82 | |
| 83 | def run_command(command: Iterable[str], *, capture_output: bool = False, check: bool = True) -> subprocess.CompletedProcess[str]: |
| 84 | result = subprocess.run( |
| 85 | list(command), |
| 86 | cwd=PROJECT_ROOT, |
| 87 | text=True, |
| 88 | capture_output=capture_output, |
| 89 | ) |
| 90 | if check and result.returncode != 0: |
| 91 | detail = (result.stderr or result.stdout or "").strip() |
| 92 | joined = " ".join(command) |
| 93 | raise LaunchError(f"命令执行失败: {joined}\n{detail}") |
| 94 | return result |
| 95 | |
| 96 | |
| 97 | def docker_ready() -> bool: |
no test coverage detected