From fb86ccd1a7bd88ef8e57522d9439626f798a30d5 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Tue, 3 Nov 2026 14:17:03 -0800 Subject: [PATCH] Fix exclusion logic to preserve original filename format for grep filter --- run_full_cleanup.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/run_full_cleanup.sh b/run_full_cleanup.sh index 20a3c63..c6accfb 100755 --- a/run_full_cleanup.sh +++ b/run_full_cleanup.sh @@ -67,8 +67,10 @@ fi EXCLUDE_FILE="" 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) + # We need to keep the original filename for the grep filter 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 echo "Excluding most recent file: $EXCLUDE_FILE" fi