-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme.sh
More file actions
51 lines (44 loc) · 1.2 KB
/
Copy pathreadme.sh
File metadata and controls
51 lines (44 loc) · 1.2 KB
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
#!/bin/bash
# CONTRIBUTION
## Author: Tom Sapletta
## Created Date: 2.05.2022
# EXAMPLE
# ./readme.sh
# TODO: github actions to merge the all files in the fly
# CONFIG
LOGS="readme.logs.txt"
PROJECTS=readme.txt
PROJECT_LIST=$(cat $PROJECTS)
LOCAL_PATH=$(pwd)
# START
echo "`date +"%T.%3N"` START" > $LOGS
echo "$(date +"%T.%3N") CREATE_MENU" >> $LOGS
#
DOMAIN=$(cat CNAME)
echo "+ [$DOMAIN](http://$DOMAIN)" > DOCS/PROJECTS.md
echo "+ [$LOCAL_PATH](file://$LOCAL_PATH/)" > DOCS/PROJECTS_LOCAL.md
#
for FILE in */in.md; do
line=$(head -n 1 $FILE)
#echo "$FILE $line"
#echo PROTOCOL=${URL%%://*}
NAME=${FILE%%/*}
URL=$DOMAIN/$NAME
echo "+ [$NAME $line](http://$URL)" >> DOCS/PROJECTS.md
echo "+ [$NAME $line](file://$LOCAL_PATH/$NAME/index.html)" >> DOCS/PROJECTS_LOCAL.md
done
## combine from another sites
echo "$(date +"%T.%3N") COMBINE_FILES" >> $LOGS
echo "" > README.md
for project in $PROJECT_LIST; do
echo "$(date +"%T.%3N") COMBINE_FILE $project" >> $LOGS
cat $project >> README.md
echo "" >> README.md
done
# Send to github
#git commit -m "Combine and update docs"
#git push
#firefox https://github.com/php-func/www
#open https://www.phpfunc.com/
echo "`date +"%T.%3N"` STOP" >> $LOGS
cat $LOGS