-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkreadme.sh
executable file
·59 lines (53 loc) · 1.41 KB
/
mkreadme.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
#!/bin/sh
if [ -f README.md.orig ]
then
mv README.md.orig README-input-$$.md
else
git checkout master -- README.md
mv README.md README-input-$$.md
fi
cat > README.md << QUICKLINK
- [code analysis reports](#code-analysis-reports)
QUICKLINK
cat README-input-$$.md >> README.md
rm -f README-input-$$.md
cat >> README.md << HEAD
----------------------
# Code analysis reports
HEAD
(
[ -d analysis ] && if [ "`ls -A analysis`" ]
then
echo '- Clang static code analysis reports:'
for REPORTDIR in analysis/*
do
ID=${REPORTDIR#analysis/}
DATE=${ID%-*-*-*}
REMAIN=${ID#*-*-*-}
TIME=${REMAIN%-*-*}
HOUR=${TIME%????}
MINSECS=${TIME#??}
MINS=${MINSECS%??}
SECS=${MINSECS#??}
echo " - [issues found on ${DATE} ${HOUR}:${MINS}.${SECS}](${REPORTDIR}/index.html)"
done
fi
[ -d coverage ] && if [ "`ls -A coverage`" ]
then
echo '- Code coverage from `ithitest` program:'
for SRCDIR in `find coverage -type d -name src`
do
REPORTDIR=${SRCDIR%/src}
BRANCH=${REPORTDIR#coverage/}
echo " - [from branch ${BRANCH}](${REPORTDIR}/index.html)"
done
fi
echo '- [Doxygen documentation (for master branch)](doxygen/index.html)'
echo ''
) >> README.md
git add README.md
awk 'BEGIN{p=1}!/^ - /{p=1}/^include:/{p=0}{if(p)print}' _config.yml > _config.yml.new
echo 'include:' >> _config.yml.new
find doxygen -type f -name "_*" | sed 's/^doxygen\// - /g' | sort >> _config.yml.new
mv _config.yml.new _config.yml
git add _config.yml