From 397a32a51c65eefdd3902f452c0009c99e208133 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Mon, 4 Apr 2016 17:37:42 +0200 Subject: [PATCH] factor error-ignoring code into a function --- git-latexdiff | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/git-latexdiff b/git-latexdiff index 397ad67..0c22f66 100755 --- a/git-latexdiff +++ b/git-latexdiff @@ -515,6 +515,13 @@ else bblexpand=() fi +ignore_errors_maybe() { + if [ "$compile_error" = 1 ] && [ "$ignorelatexerrors" = 1 ]; then + echo "LaTeX errors were found - but attempting to carry on." + compile_error=0 + fi +} + # Create flattened documents and keep for debugging if test "$flatten" = 1; then if [ "$bbl" = 1 ]; then @@ -597,10 +604,7 @@ fi verbose_done -if [ "$compile_error" = 1 ] && [ "$ignorelatexerrors" = 1 ]; then - echo "LaTeX errors were found - but attempting to carry on." - compile_error=0 -fi +ignore_errors_maybe if test $latex = 1; then dvips "$mainbase".dvi