testsAndMisc/linux_configuration/scripts/periodic_background
Krzysztof kuhy Rudnicki 1dceca6600 install_leechblock: split into lib/ under the 250-line cap
485 -> 114 lines, with the six install phases moved into four sourced
libs: leechblock_fetch.sh, leechblock_config.sh, leechblock_browsers.sh
and leechblock_firefox.sh.

detect_browsers, replace_browser_in_place and wire_up_browsers stay in
one lib on purpose: detect_browsers writes the BROWSERS/FIREFOXES arrays
that wire_up_browsers reads, and splitting them would create a
write-only cross-file global.

Four justified body changes, all recorded in the evidence:

- Quoted the six hyphenated associative-array keys. shfmt 3.13.1 parses
  an unquoted [google-chrome-stable] as arithmetic and rewrites it to
  [google - chrome - stable], which would break browser detection
  entirely. The pre-commit hook runs shfmt -w on staged files and
  re-stages them, so this corruption would have landed in the commit
  unseen -- this is what caused the previous attempt at this split to be
  reverted. Behaviour-preserving: quoted and unquoted are the same key.

- SCRIPT_DIR is assigned in the entry script rather than inside
  inject_default_config. Left in the lib, ${BASH_SOURCE[0]} resolves to
  lib/, so the defaults JSON lookup would miss and default blocking
  rules would silently never be seeded.

- install_firefox_policy takes ff_found as a parameter instead of
  reading it as a cross-file global, fixing a genuine SC2154 without a
  suppression.

- Added require_cmd unzip. It was used bare under set -Eeuo pipefail, so
  a missing unzip would abort after the version dir was populated but
  before the 'current' symlink was made, leaving a half-installed tree.

verify_shell_split.sh reports additions only -- no -/+ pair -- so
get_latest_tag and replace_browser_in_place moved byte-identically.
--help and unrecognized-flag output are byte-identical to the baseline.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 15:32:48 +02:00
..
digital_wellbeing install_leechblock: split into lib/ under the 250-line cap 2026-08-21 15:32:48 +02:00
hosts hosts/install: split into lib/ under the 250-line cap 2026-08-21 14:45:04 +02:00
i3-configuration i3blocks: add Claude usage block, fix icon rendering, drop dead blocks 2026-08-10 15:14:34 +02:00
lib check_and_enable_services: a warning must never mask an error 2026-08-21 14:16:01 +02:00
system-maintenance usage_report: delete the dead _compute_window shim 2026-08-17 12:57:52 +02:00
utils Fail the build on any shellcheck finding; fix the 222 the old gate hid 2026-08-03 19:49:11 +02:00
check_and_enable_services.sh check_and_enable_services: 100% coverage via a redirectable path prefix 2026-08-21 14:08:11 +02:00
setup_periodic_system.sh Split two more linux_configuration scripts; revert a third 2026-08-16 18:44:18 +02:00