Merge pull request #8835 from basecamp/fix-browser-policy-exit-trap

Fix migration 1787515927 failing on Bash 5.3

(cherry picked from commit 62eb5182d0)
This commit is contained in:
Ryan Hughes committed 2026-08-28 22:55:52 -04:00
1 parent da0fe6d89f
commit 3bb9867245
3 files changed
+29 -2

No files matched your search

+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