MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / run_command

Function run_command

etc/release/scancode_release_tests.py:97–113  ·  view source on GitHub ↗

Run a command list of `args` in a subprocess. Print the output. Exit on error.

(args)

Source from the content-addressed store, hash-verified

95
96
97def run_command(args):
98 """
99 Run a command list of `args` in a subprocess. Print the output. Exit on
100 error.
101 """
102 cmd = " ".join(args)
103 print()
104 print(f"Running command: {cmd}")
105 try:
106 output = subprocess.check_output(args, encoding="utf-8", shell=on_windows)
107 print(f"Success to run command: {cmd}")
108 print(output)
109
110 except subprocess.CalledProcessError as cpe:
111 print(f"Failure to run command: {cmd}")
112 print(cpe.output)
113 sys.exit(128)
114
115
116if __name__ == "__main__":

Callers 1

run_app_smoke_testsFunction · 0.85

Calls 2

exitMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected