(cmd, *, cwd=None)
| 28 | |
| 29 | |
| 30 | def _run_quiet(cmd, *, cwd=None): |
| 31 | if cwd: |
| 32 | print('+', 'cd', cwd, flush=True) |
| 33 | print('+', shlex.join(cmd), flush=True) |
| 34 | try: |
| 35 | return subprocess.run( |
| 36 | cmd, |
| 37 | cwd=cwd, |
| 38 | capture_output=True, |
| 39 | text=True, |
| 40 | check=True, |
| 41 | ) |
| 42 | except subprocess.CalledProcessError as err: |
| 43 | # Don't be quiet if things fail |
| 44 | print(f"{err.__class__.__name__}: {err}") |
| 45 | print("--- STDOUT ---") |
| 46 | print(err.stdout) |
| 47 | print("--- STDERR ---") |
| 48 | print(err.stderr) |
| 49 | print("---- END ----") |
| 50 | raise |
| 51 | |
| 52 | |
| 53 | def _run_stdout(cmd): |
no test coverage detected
searching dependent graphs…