Support per-sample Delta-E references via NAME > REF

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-23 09:33:52 +03:30
parent bb6e6d9b64
commit f7e3731724
6 changed files with 108 additions and 78 deletions

View File

@@ -128,13 +128,13 @@ wait_for_instrument() {
scan_samples() {
[[ -f "$SAMPLES_FILE" ]] || fail "$SAMPLES_FILE not found"
# Strip a leading "*" (the Delta-E reference marker) from displayed names.
# Strip an optional " > REF" suffix from displayed names.
# A while-read loop is used instead of mapfile for bash 3.2 (macOS) support.
SAMPLES=()
while IFS= read -r line; do
SAMPLES+=("$line")
done < <(grep -v '^#' "$SAMPLES_FILE" | grep -v '^[[:space:]]*$' \
| sed -E 's/^[[:space:]]*\*[[:space:]]*//')
| sed -E 's/[[:space:]]*>.*$//')
local count="${#SAMPLES[@]}"
[[ "$count" -gt 0 ]] || fail "No sample names found in $SAMPLES_FILE"