Now we can build only one program
./programme.sh my_directory
This commit is contained in:
parent
1eacf73b67
commit
78931654ac
27
programme.sh
27
programme.sh
|
@ -5,16 +5,33 @@ function path_to_name {
|
||||||
echo ${PROGRAMPATH//\_/\ }
|
echo ${PROGRAMPATH//\_/\ }
|
||||||
}
|
}
|
||||||
|
|
||||||
for directory in $(find . -name programme -type d); do
|
function buildProg()
|
||||||
|
{
|
||||||
|
directory="$1"
|
||||||
cat > programme_options.tex <<EOB
|
cat > programme_options.tex <<EOB
|
||||||
\\newcommand{\\formation}{$(path_to_name $(basename ${directory%/programme}))}
|
\\newcommand{\\formation}{$(path_to_name $(basename ${directory%/programme}))}
|
||||||
\\newcommand{\\dossier}{$directory}
|
\\newcommand{\\dossier}{$directory}
|
||||||
EOB
|
EOB
|
||||||
#cat programme_options.tex
|
|
||||||
xelatex programme.tex
|
xelatex programme.tex
|
||||||
xelatex programme.tex
|
xelatex programme.tex
|
||||||
|
set -x
|
||||||
mv programme.pdf $directory/plan_de_formation_$(basename ${directory%/programme}).pdf
|
mv programme.pdf $directory/plan_de_formation_$(basename ${directory%/programme}).pdf
|
||||||
|
set +x
|
||||||
rm -f programme_options.tex
|
rm -f programme_options.tex
|
||||||
done
|
}
|
||||||
|
|
||||||
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
|
||||||
|
|
Loading…
Reference in New Issue