Fix exclusion logic to preserve original filename format for grep filter

This commit is contained in:
Hermes Agent 2026-11-03 14:17:03 -08:00
parent 22cc7e0872
commit fb86ccd1a7

View file

@ -67,8 +67,10 @@ fi
EXCLUDE_FILE="" EXCLUDE_FILE=""
if [ "$IS_DIR" = true ] && [ "$SKIP_MOST_RECENT" = true ]; then if [ "$IS_DIR" = true ] && [ "$SKIP_MOST_RECENT" = true ]; then
# Find the most recent file by filename date (format: YYYY_MM_DD.md or YYYY-MM-DD.md) # Find the most recent file by filename date (format: YYYY_MM_DD.md or YYYY-MM-DD.md)
# We need to keep the original filename for the grep filter
EXCLUDE_FILE=$(find "$TARGET" -maxdepth 1 -name '*.md' -type f | \ EXCLUDE_FILE=$(find "$TARGET" -maxdepth 1 -name '*.md' -type f | \
sed 's/.*\///' | sed 's/_/-/g' | sort -r | head -1) sed 's|.*/||' | sed 's/_/-/g' | sort -r | head -1 | \
sed 's/-/_/g')
if [ -n "$EXCLUDE_FILE" ]; then if [ -n "$EXCLUDE_FILE" ]; then
echo "Excluding most recent file: $EXCLUDE_FILE" echo "Excluding most recent file: $EXCLUDE_FILE"
fi fi