aboutsummaryrefslogtreecommitdiff
path: root/scripts/wipedisk
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-27 13:44:13 -0400
committerCraig Jennings <c@cjennings.net>2026-06-27 13:44:13 -0400
commitba07886525acfb78999d98c4c1a06bc4c08e8d95 (patch)
tree1afe0919cbf0793a241ef004a0b9b0d8114b3f8f /scripts/wipedisk
parente33abe6fd6bde995c3f067ca023dd8f158e8cfe9 (diff)
downloadarchsetup-ba07886525acfb78999d98c4c1a06bc4c08e8d95.tar.gz
archsetup-ba07886525acfb78999d98c4c1a06bc4c08e8d95.zip
refactor: collapse describe-run-warn idiom into run_task helper
The installer announced, ran, and warned on each operation with a hand-written two-line pair, repeated ~35 times: action="enabling rngd service" && display "task" "$action" systemctl enable rngd >> "$logfile" 2>&1 || error_warn "$action" "$?" I added a run_task "desc" cmd... helper that does this in one line, plus an enable_service wrapper for the canonical "enabling <unit> service" case. The 35 single-command sites now call run_task. The three exact-wording service enables (rngd, upower, fail2ban) use enable_service. Multi-line sites (heredocs, subshells, intervening logic) keep the explicit form. Behavior is unchanged: same descriptions, same commands, same logfile redirection, same non-fatal warning on the real exit code. tests/run-task covers the helper across Normal/Boundary/Error including exit-code propagation, and the full unit suite stays green.
Diffstat (limited to 'scripts/wipedisk')
0 files changed, 0 insertions, 0 deletions