-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprompt.sh
50 lines (42 loc) · 1.11 KB
/
prompt.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# Output file
output_file="combined_code.txt"
# Empty the output file if it already exists
> "$output_file"
# Function to add a file's content to the output
add_file_content() {
local file=$1
echo "==== File: $file ====" >> "$output_file"
cat "$file" >> "$output_file"
echo -e "\n\n" >> "$output_file"
}
# Add src/generator.ts
if [ -f "src/generator.ts" ]; then
add_file_content "src/generator.ts"
else
echo "src/generator.ts not found" >> "$output_file"
fi
# Add files from src/utils directory
if [ -d "src/utils" ]; then
for file in src/utils/*; do
if [ -f "$file" ]; then
add_file_content "$file"
fi
done
else
echo "src/utils directory not found" >> "$output_file"
fi
# Add files from src/types directory
if [ -d "src/types" ]; then
for file in src/types/*; do
if [ -f "$file" ]; then
add_file_content "$file"
fi
done
else
echo "src/types directory not found" >> "$output_file"
fi
# add bin and index
add_file_content "bin.ts"
add_file_content "index.ts"
echo "All files have been combined into $output_file"