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

Function execute

python/pminit/post-install-hook.py:5–15  ·  view source on GitHub ↗
(cmd: str)

Source from the content-addressed store, hash-verified

3import shutil
4
5def execute(cmd: str):
6 popen = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr = subprocess.STDOUT,
7 shell = True, text = True )
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:
15 raise subprocess.CalledProcessError(return_code, cmd)
16
17def main():
18 node_package_manager = 'npm'

Callers 1

mainFunction · 0.70

Calls 2

writeMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected