MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / run_cmd

Function run_cmd

scripts/release_check.py:21–33  ·  view source on GitHub ↗

Run a command and return output, raising error by default if command fails

(cmd)

Source from the content-addressed store, hash-verified

19
20
21def run_cmd(cmd):
22 """Run a command and return output, raising error by default if command fails"""
23
24 print(f"Running command: {cmd}")
25 result = sp.run(cmd,
26 shell=True,
27 stdout=sp.PIPE,
28 text=True,
29 stderr=sp.STDOUT)
30 if result.returncode != 0:
31 print(f"Failing command output:\n{result.stdout}")
32 sys.exit(1)
33 return result
34
35
36def handle_check_failure(error_msg):

Callers 1

mainFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected