MCPcopy
hub / github.com/cosmicpython/book / run

Function run

update-exercise-branch.py:7–19  ·  view source on GitHub ↗
(cmds)

Source from the content-addressed store, hash-verified

5
6
7def run(cmds):
8 print(' '.join(cmds))
9 p = subprocess.run(
10 cmds,
11 cwd=Path(__file__).parent / 'code',
12 capture_output=True,
13 check=True
14 )
15 if p.returncode:
16 raise Exception(p.stderr.decode())
17 output = p.stdout.decode()
18 print(output)
19 return output
20
21all_branches = run(['git', 'branch', '-a'],)
22

Callers 2

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected