refactor: best_effort log for quiet steps, registered temp dirs, one exit handler

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ss5gKj7XG5JPi27XwGBGTs
This commit is contained in:
theupriserandClaude Sonnet 5.5 committed 2026-10-03 12:52:59 +02:00
1 parent bc66eb2416
commit ef514e35af
17 files changed
+100 -42

No files matched your search

+10
View File
@@ -90,6 +90,16 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine
- Bash, `set -uo pipefail` (no `-e`): check exit codes of steps that matter
explicitly (`|| { err ...; exit 1; }` or `|| return 1`).
- **Failure and quiet steps.** A function returns 0 when what it was asked
to do is in place and 1 when it isn't (after `err`); a step that is only an
extra (an icon cache, a service that may not exist) warns or stays silent and
doesn't change the return value. Never `cmd 2>/dev/null` on a step that
changes the system: use `best_effort cmd...` (same exit status, its errors go
to `$STATE_DIR/steamify.log`). `2>/dev/null` stays for probes (`pacman -Q`,
`grep -q`, `is-active`) whose failure is the answer.
- **Temp dirs.** `make_tmpdir <variable>` (not `$(mktemp -d)`, whose
subshell can't register it): the entry point's `on_exit` removes them, also
when a run stops half way. That handler is the only `EXIT` trap.
- Use the helpers from `lib/common.sh` (`info`, `ok`, `warn`, `err`,
`ask_yn`, `backup_file`) for all output and prompts.
- Runs as the normal user; use `sudo` per command, never require root.