diff options
| author | Paul Buetow <paul@buetow.org> | 2026-06-28 09:19:33 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-06-28 09:19:33 +0300 |
| commit | 86c354932e698d52f23e65a1dafb1b7250f4c1b9 (patch) | |
| tree | 2b67fdfab41fab1036c55e91bd2ddf72c25829dd /src/lib/config.validate.source.sh | |
| parent | 94479238557adcab33a95fefbf752a3742b8a8ba (diff) | |
Centralize DIST_DIR-derived paths via working_dir/exif_cache_dir helpers
The EXIF cache dir ($(dirname "$DIST_DIR")/cache/exif) was recomputed inline,
byte for byte, in both cached_photo_identify_output (read/write) and
clear_exif_cache (--force/--clean removal). The plain parent of DIST_DIR
(dirname "$DIST_DIR") was likewise recomputed in metadata-cache and in
action.source.sh's staging-artifact cleanup.
Extract two helpers computed once from DIST_DIR:
- working_dir() in config.source.sh (next to existing_parent_dir, the other
DIST_DIR-parent resolver): plain `dirname "$DIST_DIR"`.
- exif_cache_dir() in metadata-cache.source.sh (owns the EXIF cache):
`working_dir()/cache/exif`.
Route cached_photo_identify_output, clear_exif_cache, and
clean_generation_staging_artifacts through them so the cache reader and the
cleaner can never drift to different directories. Paths are byte-identical to
the prior inline code (dirname semantics, cache/exif suffix, trailing-slash and
relative/absolute handling all preserved). Stale "recompute the cache dir"
comments removed; helpers document the path once. Add a unit test asserting the
helpers agree and resolve beside dist for several DIST_DIR shapes.
Broader DIST_DIR parameterization of leaf pipeline helpers was intentionally
left out of scope (only the duplicated path computation is centralized here).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'src/lib/config.validate.source.sh')
0 files changed, 0 insertions, 0 deletions
