examdd/scrapper.sh
2025-12-25 21:44:30 +03:00

18 lines
461 B
Bash
Executable file

#!/usr/bin/env bash
OUTPUT="all_code.txt"
ROOT="."
> "$OUTPUT"
find "$ROOT" \
-type d -name "__pycache__" -prune -o \
-type f -name "*.py" ! -name "*.pyc" \
-print | sort | while read -r file; do
echo "########################################" >> "$OUTPUT"
echo "# FILE: $file" >> "$OUTPUT"
echo "########################################" >> "$OUTPUT"
echo >> "$OUTPUT"
cat "$file" >> "$OUTPUT"
echo -e "\n\n" >> "$OUTPUT"
done