(args, env, cwd=None, log=None)
| 64 | |
| 65 | |
| 66 | def command(args, env, cwd=None, log=None): |
| 67 | result = subprocess.run([str(arg) for arg in args], env=env, cwd=cwd, capture_output=True) |
| 68 | if log: |
| 69 | log.with_suffix('.stdout').write_bytes(result.stdout) |
| 70 | log.with_suffix('.stderr').write_bytes(result.stderr) |
| 71 | result.check_returncode() |
| 72 | return result.stdout |
| 73 | |
| 74 | |
| 75 | def file_bytes(path, mode): |