(cmd: str, cwd: str)
| 3 | import argparse |
| 4 | |
| 5 | def 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 | |
| 17 | def commandType(value: str): |
| 18 | if value != "npm": |