From d7c18707261dc7112455f6ee09e8143e0702b830 Mon Sep 17 00:00:00 2001 From: Chris Fenner Date: Tue, 10 Sep 2024 00:27:52 +0000 Subject: [PATCH] fail if latexdiff fails --- build.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 4bf3dc4..dcbb23f 100755 --- a/build.sh +++ b/build.sh @@ -812,10 +812,15 @@ if [ -n "${DIFFPDF_OUTPUT}" -o -n "${DIFFTEX_OUTPUT}" ]; then do_md_fixups "${BUILD_DIR}/${INPUT_FILE}" do_latex "${BUILD_DIR}/${INPUT_FILE}" "${TEMP_DIFFBASE_TEX_FILE}" "${EXTRA_PANDOC_OPTIONS} -V keepstaleimages=true" latexdiff --preamble /resources/templates/latexdiff.tex --config /resources/templates/latexdiff.cfg --append-safecmd /resources/templates/latexdiff.safe "${TEMP_DIFFBASE_TEX_FILE}" "${TEMP_TEX_FILE}" > "${TEMP_DIFF_TEX_FILE}" 2>"${TEMP_LATEXDIFF_LOG}" - do_tex_fixups "${TEMP_DIFF_TEX_FILE}" - if [ -n "${DIFFTEX_OUTPUT}" ]; then - mkdir -p "$(dirname ${SOURCE_DIR}/${DIFFTEX_OUTPUT})" - cp "${TEMP_DIFF_TEX_FILE}" "${SOURCE_DIR}/${DIFFTEX_OUTPUT}" + if [ $? -ne 0 ]; then + FAILED=true + echo "diff output failed" + else + do_tex_fixups "${TEMP_DIFF_TEX_FILE}" + if [ -n "${DIFFTEX_OUTPUT}" ]; then + mkdir -p "$(dirname ${SOURCE_DIR}/${DIFFTEX_OUTPUT})" + cp "${TEMP_DIFF_TEX_FILE}" "${SOURCE_DIR}/${DIFFTEX_OUTPUT}" + fi fi fi fi