Skip to content

Commit 6b10dbf

Browse files
committed
Harden Firefox policy dirs even when the theme refresh fails
1 parent 5925929 commit 6b10dbf

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

migrations/1787515927.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ for dir in "${BROWSER_POLICY_MANAGED_DIRS[@]}"; do
99
repaired=1
1010
done
1111

12+
# Repainting the policy color is cosmetic and the next theme change redoes it.
13+
# Under bash -euo pipefail a failure here would abort the migration before the
14+
# Firefox directories below are hardened, and the marker would never be written.
1215
if (( repaired )); then
13-
omarchy-theme-set-browser
16+
omarchy-theme-set-browser || true
1417
fi
1518

1619
for dir in "${BROWSER_POLICY_FIREFOX_DIRS[@]}"; do

test/shell.d/browser-policy-dir-test.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ cleanup || fail "omarchy-theme-set-browser-policy's EXIT trap succeeds with a st
294294
unset -f cleanup
295295
pass "omarchy-theme-set-browser-policy's EXIT trap never leaks a failure status"
296296

297+
grep -F 'omarchy-theme-set-browser || true' "$ROOT/migrations/1787515927.sh" >/dev/null ||
298+
fail "the policy-directory migration hardens Firefox even when the theme refresh fails"
299+
pass "the policy-directory migration does not abort on a failed theme refresh"
300+
297301
policy_files=(
298302
"$ROOT/bin/omarchy-install-browser"
299303
"$ROOT/bin/omarchy-provision-owner"

0 commit comments

Comments
 (0)