-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_readmes.sh
More file actions
executable file
·36 lines (27 loc) · 1023 Bytes
/
create_readmes.sh
File metadata and controls
executable file
·36 lines (27 loc) · 1023 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
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# Set the root directory (you can replace "." with a specific path if needed)
echo "Enter the path within you want to generate all the README file : "
read dir
ROOT_DIR="$dir"
# Loop through all directories in the root directory
for dir in "$ROOT_DIR"/*/; do
# Check if it's a directory
if [ -d "$dir" ]; then
# Set the README path
README_PATH="${dir}README.md"
# Check if README.md already exists in this directory
if [ ! -f "$README_PATH" ]; then
echo "Creating README.md in $dir"
# Write a basic template to the README.md file
cat <<EOT > "$README_PATH"
# $(basename "$dir")
This folder contains functions related to the $(basename "$dir") category of the library.
## Functions
- List of functions will go here.
EOT
else
echo "README.md already exists in $dir, skipping..."
fi
fi
done
echo "README.md files have been created in all folders that didn't already have one."