(cmd: str)
| 3 | import shutil |
| 4 | |
| 5 | def 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 | |
| 17 | def main(): |
| 18 | node_package_manager = 'npm' |