-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathprepare-chatgpt.sh
More file actions
26 lines (20 loc) · 747 Bytes
/
Copy pathprepare-chatgpt.sh
File metadata and controls
26 lines (20 loc) · 747 Bytes
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
#!/bin/bash
# Set source and output file
SOURCE_DIR="content"
OUTPUT_DIR="$HOME/Downloads/chatgpt"
OUTPUT_FILE="$OUTPUT_DIR/waha.md"
# Create or clear the output file
rm -f "$OUTPUT_FILE"
touch "$OUTPUT_FILE"
# Find all .md files in the source directory and combine them
find "$SOURCE_DIR" -type f -name "*.md" | while read -r file; do
# Add file name to OUTPUT_FILE
echo "\n" >> "$OUTPUT_FILE"
echo "File: $file" >> "$OUTPUT_FILE"
echo "\n" >> "$OUTPUT_FILE"
# Append the content of the file to the output file
cat "$file" >> "$OUTPUT_FILE"
done
cp -f static/swagger/openapi.json "$OUTPUT_DIR/openapi.json"
echo "All .md files combined into $OUTPUT_FILE with separators."
echo "openapi.json copied to $OUTPUT_DIR/openapi.json"