formations/programme.sh

27 lines
673 B
Bash
Raw Normal View History

#!/bin/bash
function path_to_name {
PROGRAMPATH=$1
echo ${PROGRAMPATH//\_/\ }
}
if [ "$1" = '' ]
then
rep='.'
else
rep="$1"
fi
2013-08-02 10:42:38 +02:00
for directory in $(find "$rep" -name programme -type d); do
cat > programme_options.tex <<EOB
\\newcommand{\\formation}{$(path_to_name $(basename ${directory%/programme}))}
\\newcommand{\\dossier}{$directory}
EOB
#cat programme_options.tex
xelatex programme.tex
xelatex programme.tex
mv programme.pdf $directory/plan_de_formation_$(basename ${directory%/programme}).pdf
rm -f programme_options.tex
done
2013-08-02 10:42:38 +02:00
tar -cf plans_de_formation.tar.gz --xform s:^.*/:: $(find . -name "plan_de_formation_*.pdf" -type f)