From 1d6a00fd71cb8ea093da2f217f1724f4d5df1c85 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 27 Jun 2026 10:52:37 +0300 Subject: Fix src/shuriken.sh lib source list missing 5 modules Running `bash src/shuriken.sh --generate ...` directly from a source checkout printed "command not found" for camera_label_from_make_model, photo_exif_values_to and cached_photo_identify_output for every photo, silently emptying EXIF tooltips/details and, with STATS_PAGE=yes, omitting the whole stats/ tree. The hand-maintained source list inside the SHURIKEN_LIB_SOURCES_BEGIN/END marker block had drifted from the authoritative Justfile LIB_SOURCES, missing metadata-label, metadata-cache, stats-aggregate, stats-render and stats-filter-album. `just build` replaces the marker block with LIB_SOURCES when generating bin/shuriken, so the installed binary and the bin-based test suite never noticed; only direct src execution was affected. - Add the 5 missing `source` lines to the marker block in the same order as Justfile LIB_SOURCES, so the two lists now match exactly. - Add tests/cli.sh case test_lib_sources_match_justfile_lib_sources that extracts the marker-block module names and asserts they equal the Justfile LIB_SOURCES (same set and order) to prevent future drift. - shellcheck --check-sourced now follows the 5 newly-sourced libs; suppress the cross-module nameref false positives (SC2178/SC2128/ SC2154) with explained directives and genuinely fix SC2004 (counts_ref[$key] -> [key]) and quote the TITLE default (${TITLE:-}). bin/shuriken changes only by these propagated lib edits; the marker-block source list it generates is unchanged. Co-Authored-By: Claude Opus 4.8 --- src/lib/metadata-cache.source.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/metadata-cache.source.sh') diff --git a/src/lib/metadata-cache.source.sh b/src/lib/metadata-cache.source.sh index 7c6d2e3..aa580b6 100644 --- a/src/lib/metadata-cache.source.sh +++ b/src/lib/metadata-cache.source.sh @@ -135,7 +135,10 @@ photo_exif_values_to() { # shellcheck disable=SC2034 output_ref["${BASH_REMATCH[1]}"]="${BASH_REMATCH[2]}" elif [[ "$line" =~ ^[[:space:]]*Geometry:[[:space:]]*(.*)$ ]]; then - # shellcheck disable=SC2034 + # __geometry is a literal array key, not a variable; --check-sourced + # nameref aliasing across modules misreads it (SC2154). SC2034 covers + # the caller-owned array write. + # shellcheck disable=SC2034,SC2154 output_ref[__geometry]="${BASH_REMATCH[1]}" fi done -- cgit v1.2.3