collecting readme.mds

This commit is contained in:
2026-02-12 12:06:20 +01:00
parent fdfa87a54b
commit ef122ba2a7
+20
View File
@@ -136,8 +136,28 @@ for repo_dir in */; do
} > "$output_file" } > "$output_file"
# Find all files, excluding skip dirs # Find all files, excluding skip dirs
# First pass: collect READMEs
while IFS= read -r -d '' file; do while IFS= read -r -d '' file; do
rel_path="${file#${repo_dir}/}" rel_path="${file#${repo_dir}/}"
{
echo "--- FILE: ${rel_path} ---"
cat "$file"
echo ""
echo ""
} >> "$output_file"
file_count=$((file_count + 1))
done < <(find "$repo_dir" -type f -iname 'readme.md' \
! -path '*/.git/*' \
-print0 | sort -z)
# Second pass: everything else (excluding READMEs)
while IFS= read -r -d '' file; do
rel_path="${file#${repo_dir}/}"
# Skip READMEs (already included above)
if echo "$(basename "$file")" | grep -qi '^readme\.md$'; then
continue
fi
# Skip files with "secret" in the name # Skip files with "secret" in the name
if echo "$rel_path" | grep -qi 'secret'; then if echo "$rel_path" | grep -qi 'secret'; then