summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordev_Hakaze <af.nawfal@gmail.com>2026-07-24 00:53:39 +0700
committerDrew Ritter <drew@ritter.dev>2026-07-23 17:27:16 -0700
commit6015d37fe623cf0a7982d6f93fde0c6fef2f92b0 (patch)
tree81c395cfcc7a14b71eac1ff659d2a38124add6df
parenta868631a8a4a942656b7837b60f24c393f86547a (diff)
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>
-rwxr-xr-xskills/systematic-debugging/find-polluter.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/skills/systematic-debugging/find-polluter.sh b/skills/systematic-debugging/find-polluter.sh
index 1d71c56..d2261c4 100755
--- a/skills/systematic-debugging/find-polluter.sh
+++ b/skills/systematic-debugging/find-polluter.sh
@@ -18,9 +18,13 @@ echo "🔍 Searching for test that creates: $POLLUTION_CHECK"
echo "Test pattern: $TEST_PATTERN"
echo ""
-# Get list of test files
-TEST_FILES=$(find . -path "$TEST_PATTERN" | sort)
-TOTAL=$(echo "$TEST_FILES" | wc -l | tr -d ' ')
+# Get list of test files (find . emits ./-prefixed paths)
+TEST_FILES=$(find . -path "./$TEST_PATTERN" | sort)
+if [ -z "$TEST_FILES" ]; then
+ TOTAL=0
+else
+ TOTAL=$(printf '%s\n' "$TEST_FILES" | wc -l | tr -d ' ')
+fi
echo "Found $TOTAL test files"
echo ""