diff --git a/collect-repos.sh b/collect-repos.sh index 18f5b17..6a35330 100644 --- a/collect-repos.sh +++ b/collect-repos.sh @@ -136,8 +136,28 @@ for repo_dir in */; do } > "$output_file" # Find all files, excluding skip dirs + # First pass: collect READMEs while IFS= read -r -d '' file; do 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 if echo "$rel_path" | grep -qi 'secret'; then