MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / run_command

Function run_command

bbot/scripts/benchmark_report.py:17–26  ·  view source on GitHub ↗

Run a shell command and return the result.

(cmd: List[str], cwd: Path = None, capture_output: bool = True)

Source from the content-addressed store, hash-verified

15
16
17def run_command(cmd: List[str], cwd: Path = None, capture_output: bool = True) -> subprocess.CompletedProcess:
18 """Run a shell command and return the result."""
19 try:
20 result = subprocess.run(cmd, cwd=cwd, capture_output=capture_output, text=True, check=True)
21 return result
22 except subprocess.CalledProcessError as e:
23 print(f"Command failed: {' '.join(cmd)}")
24 print(f"Exit code: {e.returncode}")
25 print(f"Error output: {e.stderr}")
26 raise
27
28
29def get_current_branch() -> str:

Callers 3

get_current_branchFunction · 0.85
checkout_branchFunction · 0.85
run_benchmarksFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…