fix(check-config): normalize EXCLUDE_SOURCES (lowercase + whitespace) before matching
The bash banner accounting used raw substring matching while pipeline.py normalises EXCLUDE_SOURCES via .strip().lower(). With EXCLUDE_SOURCES=TikTok,Instagram (or with surrounding spaces), pipeline correctly excludes the sources but the banner did not deduct them — count showed 1-2 higher than what the pipeline actually runs. Normalisation now mirrors the Python side (lowercase, collapse whitespace around commas, strip outer whitespace). Reproducer (clean HOME with config EXCLUDE_SOURCES=TikTok,Instagram): before: /last30days: Ready — 7 sources active. after: /last30days: Ready — 5 sources active. Addresses Greptile review comment P1 on #399.
This commit is contained in:
@@ -97,13 +97,17 @@ if [[ -n "$HAS_BSKY" ]]; then
|
|||||||
SOURCE_COUNT=$((SOURCE_COUNT + 1))
|
SOURCE_COUNT=$((SOURCE_COUNT + 1))
|
||||||
fi
|
fi
|
||||||
if [[ -n "$HAS_SCRAPECREATORS" ]]; then
|
if [[ -n "$HAS_SCRAPECREATORS" ]]; then
|
||||||
# Start with Reddit comments + TikTok + Instagram, subtract any in EXCLUDE_SOURCES
|
# Start with Reddit comments + TikTok + Instagram, subtract any in EXCLUDE_SOURCES.
|
||||||
|
# Normalise EXCLUDED (lowercase + collapse whitespace around commas + strip outer
|
||||||
|
# whitespace) so the matching mirrors pipeline.py's .strip().lower() parsing.
|
||||||
SC_ADD=3
|
SC_ADD=3
|
||||||
EXCLUDED="${ENV_EXCLUDE_SOURCES:-${EXCLUDE_SOURCES:-}}"
|
EXCLUDED="${ENV_EXCLUDE_SOURCES:-${EXCLUDE_SOURCES:-}}"
|
||||||
if [[ ",$EXCLUDED," == *",tiktok,"* ]]; then
|
EXCLUDED_NORM=$(printf '%s' "$EXCLUDED" | tr '[:upper:]' '[:lower:]' \
|
||||||
|
| sed -E 's/[[:space:]]*,[[:space:]]*/,/g; s/^[[:space:]]+//; s/[[:space:]]+$//')
|
||||||
|
if [[ ",$EXCLUDED_NORM," == *",tiktok,"* ]]; then
|
||||||
SC_ADD=$((SC_ADD - 1))
|
SC_ADD=$((SC_ADD - 1))
|
||||||
fi
|
fi
|
||||||
if [[ ",$EXCLUDED," == *",instagram,"* ]]; then
|
if [[ ",$EXCLUDED_NORM," == *",instagram,"* ]]; then
|
||||||
SC_ADD=$((SC_ADD - 1))
|
SC_ADD=$((SC_ADD - 1))
|
||||||
fi
|
fi
|
||||||
SOURCE_COUNT=$((SOURCE_COUNT + SC_ADD))
|
SOURCE_COUNT=$((SOURCE_COUNT + SC_ADD))
|
||||||
|
|||||||
Reference in New Issue
Block a user