forward the exit code

This commit is contained in:
2025-11-04 18:59:30 +01:00
parent 270518b7e9
commit ed7f14ec3a
2 changed files with 5 additions and 2 deletions

View File

@ -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")

View File

@ -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"