print exist status

This commit is contained in:
Danilo Reyes
2026-02-28 19:40:55 -06:00
parent 12df61c524
commit 5ad8fc0dc8

View File

@@ -60,7 +60,12 @@ def clean_cache(directory: Path):
shutil.rmtree(directory) shutil.rmtree(directory)
def run(command: str | Sequence[str], verbose: bool, cwd: Path | None = None) -> None: def run(
command: str | Sequence[str],
verbose: bool,
cwd: Path | None = None,
check: bool = False,
) -> None:
"""Run command in a subprocess""" """Run command in a subprocess"""
# pylint: disable=subprocess-run-check # pylint: disable=subprocess-run-check
# This toggle allows for a really wasy debug when using -v # This toggle allows for a really wasy debug when using -v
@@ -77,7 +82,9 @@ def run(command: str | Sequence[str], verbose: bool, cwd: Path | None = None) ->
else: else:
args = list(command) args = list(command)
subprocess.run(args, check=False, cwd=cwd) result = subprocess.run(args, check=check, cwd=cwd)
if not check and result.returncode != 0:
LOG.warning("Command failed (%s): %s", result.returncode, args)
def list_lines(i: int, line: str) -> str: def list_lines(i: int, line: str) -> str: