Run a shell command.
(
cmd: str, capture_output: bool = False, check: bool = True
)
| 46 | |
| 47 | |
| 48 | def run_cmd( |
| 49 | cmd: str, capture_output: bool = False, check: bool = True |
| 50 | ) -> Optional[str]: |
| 51 | """Run a shell command.""" |
| 52 | if not capture_output: |
| 53 | print(f"🔧 {cmd}") |
| 54 | if capture_output: |
| 55 | result = subprocess.run( |
| 56 | cmd, shell=True, capture_output=True, text=True, check=check |
| 57 | ) |
| 58 | return result.stdout.strip() |
| 59 | else: |
| 60 | subprocess.run(cmd, shell=True, check=check) |
| 61 | return None |
| 62 | |
| 63 | |
| 64 | def check_claude_code_available() -> Optional[str]: |
no outgoing calls
no test coverage detected