From 5ad8fc0dc8fbe3fd3a9509ca4e109983790f3ac8 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Sat, 28 Feb 2026 19:40:55 -0600 Subject: [PATCH] print exist status --- src/download/functions.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/download/functions.py b/src/download/functions.py index 587b1c9..6ce7a37 100644 --- a/src/download/functions.py +++ b/src/download/functions.py @@ -60,7 +60,12 @@ def clean_cache(directory: Path): 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""" # pylint: disable=subprocess-run-check # 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: 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: