MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / execute

Function execute

python/pminit/pminit/cli.py:5–15  ·  view source on GitHub ↗
(cmd: str, cwd: str)

Source from the content-addressed store, hash-verified

3import argparse
4
5def execute(cmd: str, cwd: str):
6 popen = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr = subprocess.STDOUT,
7 shell = True, text = True, cwd = cwd )
8 for stdout_line in iter(popen.stdout.readline, ""):
9 sys.stdout.write(stdout_line)
10 sys.stdout.flush()
11
12 popen.stdout.close()
13 return_code = popen.wait()
14 if return_code != 0:
15 sys.exit(return_code)
16
17def commandType(value: str):
18 if value != "npm":

Callers 1

mainFunction · 0.70

Calls 2

writeMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected