MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / run_command

Function run_command

tools/build.py:9–22  ·  view source on GitHub ↗
(cmd, cwd=None)

Source from the content-addressed store, hash-verified

7
8
9def run_command(cmd, cwd=None):
10 print('Running command: %s' % (' '.join(cmd)))
11 p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
12 stderr=subprocess.STDOUT, cwd=cwd)
13 while True:
14 p.stdout.flush()
15 line = p.stdout.read(1)
16 if line:
17 print(line.decode('utf-8', 'ignore'), end='')
18 else:
19 if p.poll() is not None:
20 break
21 if p.returncode != 0:
22 raise ValueError('Process finished with error code %d' % p.returncode)
23
24
25class Generator:

Callers 2

configFunction · 0.70
buildFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected