Stop the browser policy EXIT trap from reporting a clean run as failed

This commit is contained in:
Ryan Hughes
2026-08-28 19:00:03 -04:00
parent 7d58bb9a62
commit 5925929cb6
2 changed files with 21 additions and 1 deletions
+6 -1
View File
@@ -76,8 +76,13 @@ require_root "$color"
failed=0
staged=""
# Bash 5.3 makes the EXIT trap's last command decide the script's exit status,
# so this handler must not end on a false test. Every successful run clears
# staged, and a trailing `[[ -n $staged ]] && ...` would report that as failure.
cleanup() {
[[ -n $staged ]] && rm -f "$staged"
if [[ -n $staged ]]; then
rm -f "$staged"
fi
}
trap cleanup EXIT