Now we can build only one program

./programme.sh my_directory
This commit is contained in:
Philippe Caseiro 2017-09-29 12:49:00 +02:00 committed by Benjamin Bohard
parent 778e98356a
commit 750d161159
1 changed files with 27 additions and 10 deletions

View File

@ -11,16 +11,33 @@ else
rep="$1"
fi
for directory in $(find "$rep" -name programme -type d); do
cat > programme_options.tex <<EOB
\\newcommand{\\formation}{$(path_to_name $(basename ${directory%/programme}))}
function buildProg()
{
directory="$1"
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
xelatex programme.tex
xelatex programme.tex
set -x
mv programme.pdf $directory/plan_de_formation_$(basename ${directory%/programme}).pdf
set +x
rm -f programme_options.tex
}
tar -cf plans_de_formation.tar.gz --xform s:^.*/:: $(find . -name "plan_de_formation_*.pdf" -type f)
if [[ -n ${1} ]]
then
if [[ -d ${1} ]]
then
buildProg "${1}/programme"
else
echo "$1 does not exits !"
exit 4
fi
else
for directory in $(find . -name programme -type d); do
buildProg $directory
done
tar -cf plans_de_formation.tar.gz --xform s:^.*/:: $(find . -name "plan_de_formation_*.pdf" -type f)
fi