forked from gridcentric/grinder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhtml.sh
More file actions
executable file
·25 lines (22 loc) · 817 Bytes
/
html.sh
File metadata and controls
executable file
·25 lines (22 loc) · 817 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
#!/bin/bash
mkdir -p html
for x in logs/*.xml; do
if [ ! -r $x ]; then
continue
fi
y=html/$(basename $x .xml).html
if [ ! -e $y -o $x -nt $y ]; then
echo "generating $y"
xsltproc junit2html.xslt $x > $y
# pyunit does some xml escaping wrong. It ouputs > when it
# should output >. We fix it up with sed here.
sed -i 's/&\(gt\|amp\|apos\|quot\);/\&\1;/g' $y
touch --date="$(stat --printf '%y' $x)" $y
fi
done
echo "generating html/index.html"
echo '<html><body><tt>' > html/index.html
for x in $(ls -t html | grep '.*\.html$' | grep -v index.html); do
echo "$(stat --printf '%y' html/$x | sed 's/\..*//') <a href=\"$x\">$(basename $x .html)</a><br/>" >> html/index.html
done
echo '</tt></body></html>' >> html/index.html