(cmd: List[str], check: bool=True, capture: bool=False)
| 608 | input(tr(cfg, "press_enter")) |
| 609 | |
| 610 | def run(cmd: List[str], check: bool=True, capture: bool=False) -> subprocess.CompletedProcess: |
| 611 | env = os.environ.copy() |
| 612 | env.setdefault("TERM", "dumb") |
| 613 | if capture: |
| 614 | return subprocess.run(cmd, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=check, env=env) |
| 615 | return subprocess.run(cmd, check=check, env=env) |
| 616 | |
| 617 | def sh_quote(s: str) -> str: |
| 618 | return "'" + s.replace("'", "'\"'\"'") + "'" |
no test coverage detected