MCPcopy Create free account
hub / github.com/Coooolfan/onlyboxes / run_cmd

Function run_cmd

scripts/install.py:205–216  ·  view source on GitHub ↗
(args: List[str], cwd: Optional[str] = None, check: bool = True)

Source from the content-addressed store, hash-verified

203
204
205def run_cmd(args: List[str], cwd: Optional[str] = None, check: bool = True) -> subprocess.CompletedProcess:
206 result = subprocess.run(
207 args,
208 cwd=cwd,
209 stdout=subprocess.PIPE,
210 stderr=subprocess.PIPE,
211 universal_newlines=True,
212 )
213 if check and result.returncode != 0:
214 stderr = result.stderr.strip() or result.stdout.strip()
215 fatal("command", f"`{' '.join(args)}` failed:\n{stderr}")
216 return result
217
218
219def api_request(

Callers 5

has_dockerFunction · 0.85
has_docker_composeFunction · 0.85
has_systemdFunction · 0.85
install_systemd_serviceFunction · 0.85
mainFunction · 0.85

Calls 1

fatalFunction · 0.70

Tested by

no test coverage detected