MCPcopy Create free account
hub / github.com/microsoft/BitNet / run_command

Function run_command

utils/convert-helper-bitnet.py:9–17  ·  view source on GitHub ↗
(command_list, cwd=None, check=True)

Source from the content-addressed store, hash-verified

7from pathlib import Path
8
9def run_command(command_list, cwd=None, check=True):
10 print(f"Executing: {' '.join(map(str, command_list))}")
11 try:
12 process = subprocess.run(command_list, cwd=cwd, check=check, capture_output=False, text=True)
13 return process
14 except subprocess.CalledProcessError as e:
15 print(f"Error executing command: {' '.join(map(str, e.cmd))}")
16 print(f"Return code: {e.returncode}")
17 raise
18
19def main():
20 if len(sys.argv) < 2:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected