You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.6 KiB
Bash
80 lines
1.6 KiB
Bash
#!/bin/bash
|
|
set -e
|
|
export LC_ALL=cs_CZ
|
|
|
|
for a in bp dp phd ; do
|
|
rm -rf vzor-$a{,-win,-iso}
|
|
git archive --prefix=vzor-$a/ HEAD | tar xf -
|
|
rm -rf vzor-$a/{mkdist,upload,uprava,slides,TODO}
|
|
done
|
|
|
|
# BP
|
|
(
|
|
echo "Generating BP"
|
|
cd vzor-bp
|
|
cp ../uprava/bp_uprava.pdf cs/
|
|
cp ../uprava/bp_uprava_en.pdf en/
|
|
)
|
|
|
|
# DP
|
|
(
|
|
echo "Generating DP"
|
|
cd vzor-dp
|
|
cp ../uprava/dp_uprava.pdf cs/
|
|
cp ../uprava/dp_uprava_en.pdf en/
|
|
sed -i '
|
|
s/bakalářsk/diplomov/g
|
|
s/BAKALÁŘSK/DIPLOMOV/g
|
|
s/bachelor/master/g
|
|
s/BACHELOR/MASTER/g
|
|
s/bp_uprava/dp_uprava/g
|
|
' */*.tex README
|
|
if grep -Eri 'bakal|bachel' . ; then
|
|
echo >&2 "Substitutions failed"
|
|
exit 1
|
|
fi
|
|
)
|
|
|
|
# PhD
|
|
(
|
|
echo "Generating PhD"
|
|
cd vzor-phd
|
|
cp ../uprava/phd_uprava.pdf cs/
|
|
cp ../uprava/phd_uprava_en.pdf en/
|
|
sed -i '
|
|
s/bakalářské/disertační/g
|
|
s/bakalářských/disertačních/g
|
|
s/bakalářskou/disertační/g
|
|
s/BAKALÁŘSKÁ/DISERTAČNÍ/g
|
|
s/bachelor/doctoral/g
|
|
s/BACHELOR/DOCTORAL/g
|
|
s/bp_uprava/phd_uprava/g
|
|
/ Následuje vevázaný /,+2d
|
|
' */*.tex README
|
|
if grep -Eri 'bakal|bachel' . ; then
|
|
echo >&2 "Substitutions failed"
|
|
exit 1
|
|
fi
|
|
)
|
|
|
|
for a in bp dp phd ; do
|
|
# Basic version (UTF-8)
|
|
zip -r vzor-$a.zip vzor-$a
|
|
|
|
# CP1250 version
|
|
cp -a vzor-$a vzor-$a-win
|
|
for c in vzor-$a-win/{*/*.tex,README} ; do
|
|
recode utf-8..windows-1250 $c
|
|
done
|
|
sed -i 's/\[utf8]/[cp1250]/g' vzor-$a-win/{cs/prace.tex,en/thesis.tex}
|
|
zip -r vzor-$a-win.zip vzor-$a-win
|
|
|
|
# ISO-8859-2 version
|
|
cp -a vzor-$a vzor-$a-iso
|
|
for c in vzor-$a-iso/{*/*.tex,README} ; do
|
|
recode utf-8..iso-8859-2 $c
|
|
done
|
|
sed -i 's/\[utf8]/[latin2]/g' vzor-$a-iso/{cs/prace.tex,en/thesis.tex}
|
|
zip -r vzor-$a-iso.zip vzor-$a-iso
|
|
done
|