about summary refs log tree commit diff
path: root/build.sh
blob: 5ed9458388a0ba36caa98dfb480dfa47cb94bb94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

[ -d build ] && rm -r build
mkdir build
cd src

TMP=$(mktemp .tmpXXX)
find . -maxdepth 1 -type d | cut -c 3- > $TMP

cat $TMP | xargs -i sh -c 'mkdir ../build/{}; zip -r ../build/{}/materialy.zip {}'
cat $TMP | xargs -i sh -c 'cat _header.html > ../build/{}/index.html; echo "<h2>{}</h2><pre>" >> ../build/{}/index.html; cat {}/opis >> ../build/{}/index.html; cat _footer.html >> ../build/{}/index.html'
cat _header.html > ../build/index.html
echo "<pre>" >> ../build/index.html
cat ../README.md >> ../build/index.html
echo "</pre>" >> ../build/index.html
echo "<ul>" >> ../build/index.html
cat $TMP | xargs -i sh -c "echo '<li><a href=\"{}\">{}</a></li>' >> ../build/index.html"
echo "</ul></body></html>" >> ../build/index.html
rm $TMP