Skip to content

Commit 6015d37

Browse files
arimu1cursoragent
authored andcommitted
fix(systematic-debugging): match find -path ./ prefix in find-polluter.sh (#2011)
find . emits ./-prefixed paths, so -path "src/**/*.test.ts" matched nothing; wc -l on empty stdin then lied as "Found 1". Fixes #2008. Co-authored-by: arimu1 <19286898+arimu1@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a868631 commit 6015d37

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

skills/systematic-debugging/find-polluter.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ echo "🔍 Searching for test that creates: $POLLUTION_CHECK"
1818
echo "Test pattern: $TEST_PATTERN"
1919
echo ""
2020

21-
# Get list of test files
22-
TEST_FILES=$(find . -path "$TEST_PATTERN" | sort)
23-
TOTAL=$(echo "$TEST_FILES" | wc -l | tr -d ' ')
21+
# Get list of test files (find . emits ./-prefixed paths)
22+
TEST_FILES=$(find . -path "./$TEST_PATTERN" | sort)
23+
if [ -z "$TEST_FILES" ]; then
24+
TOTAL=0
25+
else
26+
TOTAL=$(printf '%s\n' "$TEST_FILES" | wc -l | tr -d ' ')
27+
fi
2428

2529
echo "Found $TOTAL test files"
2630
echo ""

0 commit comments

Comments
 (0)