Skip to content

Commit

Permalink
Merge pull request #279 from MucPeet/fix/robust-cleanup-after-bib-errors
Browse files Browse the repository at this point in the history
**fix:** Bereinigung temporärer Dateien nach Bibliographie-Fehlern
  • Loading branch information
andygrunwald authored Nov 25, 2024
2 parents 11b9d63 + 22adcd5 commit f502906
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ CMD_LATEX=lualatex
# avoid $TERM warning
export TERM=xterm-256color

# Function to remove temporary files from previously crashed runs
cleanup() {
rm -f ./*.bbl ./*.blg ./*.aux ./*.bcf ./*.ilg ./*.lof ./*.log ./*.lot ./*.nlo ./*.nls* ./*.out ./*.toc ./*.run.xml ./*.sub ./*.suc ./*.syc ./*.sym
}

# Remove existing PDF and temporary files at the beginning
rm -f "$CURRENT_DIR/thesis_main.pdf"
cleanup

echo "Compiling in Language: $1"
if [ "$1" = "en" ] || [ "$2" = "en" ] ; then
compile="$CMD_LATEX --shell-escape --jobname=\"thesis_englisch\" \"\def\FOMEN{}\input{$CURRENT_DIR/thesis_main.tex}\""
Expand Down Expand Up @@ -44,24 +53,8 @@ if [[ "${RETVAL}" -ne 0 ]] ; then
exit ${RETVAL}
fi

rm ./*.bbl 2> /dev/null
rm ./*.blg 2> /dev/null
rm ./*.aux 2> /dev/null
rm ./*.bcf 2> /dev/null
rm ./*.ilg 2> /dev/null
rm ./*.lof 2> /dev/null
rm ./*.log 2> /dev/null
rm ./*.lot 2> /dev/null
rm ./*.nlo 2> /dev/null
rm ./*.nls* 2> /dev/null
rm ./*.out 2> /dev/null
rm ./*.toc 2> /dev/null
rm ./*.run.xml 2> /dev/null
rm ./*.lot 2> /dev/null
rm ./*.sub 2> /dev/null
rm ./*.suc 2> /dev/null
rm ./*.syc 2> /dev/null
rm ./*.sym 2> /dev/null
# Remove temporary files at the end
cleanup

echo "PDF Compile: Success"

Expand Down

0 comments on commit f502906

Please sign in to comment.