Created
June 24, 2023 10:27
-
-
Save elhenro/ed355713e824d402ab1618dddbe0ef12 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OUTPUTFILE="data.txt" | |
find . -type f -not -path "./node_modules/*" | while read -r file | |
do | |
numlines=$(wc -l < "$file") | |
if [[ $numlines -lt 1000 ]]; then | |
fileext="${file##*.}" | |
echo -e "\n$file\n" >> $OUTPUTFILE | |
echo -e "\n\`\`\`$fileext\n" >> $OUTPUTFILE | |
cat "$file" >> $OUTPUTFILE | |
echo -e "\n\`\`\`\n" >> $OUTPUTFILE | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment