MCPcopy Create free account
hub / github.com/cameroncooke/skills / run_command

Function run_command

pr-learning/scripts/common.py:40–53  ·  view source on GitHub ↗
(args: list[str], stdin_text: str | None = None)

Source from the content-addressed store, hash-verified

38
39
40def 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
56def run_gh_json(args: list[str], stdin_text: str | None = None) -> Any:

Callers 3

resolve_repoFunction · 0.90
resolve_actor_loginFunction · 0.90
run_gh_jsonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected