| 61 | self.bin = bin |
| 62 | |
| 63 | def run(self, *argv, **kwargs): |
| 64 | assert hasattr(self, "bin") |
| 65 | invocation = shlex.split(self.bin) |
| 66 | invocation.extend(argv) |
| 67 | |
| 68 | for key in ["stdout", "stderr"]: |
| 69 | # Preserve caller intention, otherwise silence |
| 70 | if key not in kwargs and ctx.quiet: |
| 71 | kwargs[key] = subprocess.PIPE |
| 72 | |
| 73 | # Prefer safe by default |
| 74 | if "check" not in kwargs: |
| 75 | kwargs["check"] = True |
| 76 | |
| 77 | logger.debug(f"Executing `{invocation}`") |
| 78 | return subprocess.run(invocation, **kwargs) |
| 79 | |
| 80 | @property |
| 81 | def available(self): |