-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcat-readme-info.sh
executable file
·73 lines (65 loc) · 3.15 KB
/
cat-readme-info.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
# cat-readme-info
# This script concatenates the contents of various configuration and script files,
# prepends each with its filename, and outputs everything to a file named 'readme-info'.
# The script echoes each step it performs.
# Define the output file
OUTPUT_FILE="readme-info"
# Start with a clean output file
echo "Starting the cat-readme-info process. Creating or overwriting the $OUTPUT_FILE file."
echo "This file contains information from various configuration and script files." > $OUTPUT_FILE
# Function to cat file contents with a filename header
cat_with_filename() {
local file=$1
echo "Adding contents of $file to $OUTPUT_FILE..."
echo "=== Content of $file ===" >> $OUTPUT_FILE
cat "$file" >> $OUTPUT_FILE
echo "" >> $OUTPUT_FILE
}
# List of files to include
files=(
"README.md"
"scripts/*"
"bashrc.d/*"
"install-hpc.sh"
"install.sh"
"$HOME/.gitconfig"
"$HOME/.lintr"
"$HOME/.radian_profile"
"$HOME/.Renviron"
)
# Process each file
for file_pattern in "${files[@]}"; do
for file in $file_pattern; do
if [ -f "$file" ]; then
cat_with_filename "$file"
else
echo "No files found for pattern $file_pattern."
fi
done
done
# Add a message for ChatGPT to update the README.md
echo "Adding instructions for ChatGPT to update the README.md file."
# Add a message for ChatGPT to update the README.md
{
echo "Adding instructions for ChatGPT to update the README.md file."
echo "=== ChatGPT Instructions ==="
echo "Please update the README.md file based on the content provided here. Ensure the following elements are included:"
echo "- **Entry Points**: Highlight the main scripts such as \`install.sh\`, \`install-hpc.sh\`, and the update script for HPCs \`hpc-dotfiles-update\`. Make sure these are mentioned prominently upfront."
echo "- **TL;DR Section**: Ensure there is a brief summary section at the top for quick understanding, including entry points and common use cases."
echo "- **Help Options**: Mention that most functions and scripts have a help option. Users can run \`<command> -h\` to find out more about each command."
echo "- **Descriptions**: Provide brief descriptions of individual functions, especially the key ones."
echo "- **Maintain Links**: Keep any existing useful links and add new ones as appropriate."
echo ""
echo "In your response, DO NOT print out anything other than just the updated README.md file content."
echo "For example, do not have an introductory message saying what you're about to do or a"
echo "closing message saying what you've done."
echo "Your output should just be something I can copy and paste directly into a Markdown document"
echo "(i.e. I want the raw Markdown)."
echo "That said, DO NOT put the entire output inside Markdown fences (e.g. \`\`\`markdown at the front and end)."
echo "All I want is to be able to click that copy button at the bottom of your next message"
echo "and be able to paste that directly into a Markdown doc."
echo "Make sure that the last line is blank."
echo ""
} >> $OUTPUT_FILE
echo "cat-readme-info process complete."