botui/gencode.sh

13 lines
498 B
Bash
Raw Normal View History

2024-10-26 16:26:11 -03:00
#!/bin/bash
# Remove output.txt if it exists to start fresh
rm -f output.txt
# Find all .ts and .tsx files excluding node_modules, and concatenate filename and contents into output.txt
find . -type f \( -name "*.ts" -o -name "*.tsx" \) -not -path "*/node_modules/*" | while read -r file; do
echo -e "\n// File: $file\n" >> output.txt
cat "$file" >> output.txt
done
echo "All TypeScript (.ts and .tsx) code has been combined into output.txt with filenames as headers, excluding node_modules"