From ed7f14ec3a9c6e50dcbac15e8e027565b3281330 Mon Sep 17 00:00:00 2001 From: Moritz Date: Tue, 4 Nov 2025 18:59:30 +0100 Subject: [PATCH] forward the exit code --- alakazam.py | 5 +++-- alakazam.sh | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/alakazam.py b/alakazam.py index f34d562..11451cf 100755 --- a/alakazam.py +++ b/alakazam.py @@ -361,7 +361,7 @@ def abra(*args: str, machine_output: bool = False, ignore_error: bool = False) - logging.debug(f"run command: {' '.join(command)}") process = subprocess.run(command, capture_output=True) if process.stderr and ignore_error: - logging.debug(process.stderr.decode()) + logging.warning(process.stderr.decode()) if process.stdout: logging.debug(process.stdout.decode()) if process.returncode and not ignore_error: @@ -1093,7 +1093,8 @@ def purge(recipes: Tuple[str], noninteractive: bool) -> None: if noninteractive or input(f"Do you really want to purge these apps? Type YES: ") == "YES": for domain in domains: logging.info(f'purge {domain}') - abra("app", "rm", "-n", domain) + output = abra("app", "rm", "-n", domain, ignore_error=True) + print(output) print(f"{domain} purged") diff --git a/alakazam.sh b/alakazam.sh index 1364695..d7ec6db 100755 --- a/alakazam.sh +++ b/alakazam.sh @@ -21,4 +21,6 @@ fi # Activate the virtual environment source $VENV_PATH/bin/activate python3 $SCRIPT_DIR/alakazam.py "$@" +py_exit=$? deactivate +exit "$py_exit"