diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-24 10:22:23 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-24 10:22:23 +0300 |
| commit | 99c5241d853daceb8cfaec91023730ff062858b7 (patch) | |
| tree | 53b03fd983be4efea8374e45e9840a48ba34ca4a /src/lib/stats-aggregate.source.sh | |
| parent | 7f7ae1bef10bcf186e21a3e923b9756a50ecf52b (diff) | |
Trap-clean refresh_splash temp file; drop fragile errexit $- dance
refresh_splash mktemp'd $tmp_html was only removed on the explicit
failure-return paths, so a signal between mktemp and the final mv leaked
a .index.html.XXXXXX file in DIST_DIR that --clean (which only sweeps
.shuriken.* staging artifacts) would never reap. Register a cleanup trap
right after mktemp, mirroring source_template_file: RETURN covers normal
and error returns, INT/TERM/HUP cover signal termination, the handler
clears all of these traps (including itself), and the success path clears
the trap before the mv so the renamed file is not deleted on return.
Also remove the fragile errexit save/restore that string-tested $- to
remember whether errexit was on. refresh_splash always runs under the
top-level set -euo pipefail, so a localized "set +e; ( set -e; ... );
status=$?; set -e" around each render subshell is sufficient and matches
the project's canonical "localized set +e for expected failures" idiom.
The bare standalone subshell is required: bash ignores an inner set -e
when a compound command sits in an if/&&/|| context, which would let
render_album_splash_page run past a failing photo=$(random_splash_photo)
and silently produce a broken splash page.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/stats-aggregate.source.sh')
0 files changed, 0 insertions, 0 deletions
