Run a shell command with error handling.
(self, cmd: list, check: bool = True, capture: bool = True)
| 52 | return True |
| 53 | |
| 54 | def run_command(self, cmd: list, check: bool = True, capture: bool = True) -> subprocess.CompletedProcess: |
| 55 | """Run a shell command with error handling.""" |
| 56 | try: |
| 57 | if capture: |
| 58 | result = subprocess.run(cmd, capture_output=True, text=True, check=check) |
| 59 | else: |
| 60 | result = subprocess.run(cmd, check=check) |
| 61 | return result |
| 62 | except subprocess.CalledProcessError as e: |
| 63 | raise BridgeSetupError(f"Command failed: {' '.join(cmd)}\n{e.stderr if capture else ''}") |
| 64 | |
| 65 | def detect_primary_interface_macos(self) -> Tuple[str, str]: |
| 66 | """Detect primary network interface on macOS.""" |
no test coverage detected