(args: list[str], stdin_text: str | None = None)
| 38 | |
| 39 | |
| 40 | def run_command(args: list[str], stdin_text: str | None = None) -> str: |
| 41 | result = subprocess.run( |
| 42 | args, |
| 43 | input=stdin_text, |
| 44 | text=True, |
| 45 | stdout=subprocess.PIPE, |
| 46 | stderr=subprocess.PIPE, |
| 47 | check=False, |
| 48 | ) |
| 49 | if result.returncode != 0: |
| 50 | raise RuntimeError( |
| 51 | f"Command failed ({result.returncode}): {' '.join(args)}\n{result.stderr.strip()}" |
| 52 | ) |
| 53 | return result.stdout |
| 54 | |
| 55 | |
| 56 | def run_gh_json(args: list[str], stdin_text: str | None = None) -> Any: |
no outgoing calls
no test coverage detected