diff --git a/bash/src/bib2web.bash b/bash/src/bib2web.bash index 73d2408..0606b36 100644 --- a/bash/src/bib2web.bash +++ b/bash/src/bib2web.bash @@ -13,9 +13,7 @@ checkResultAndAbortIfNeeded() { local result="$1" if [ "${result}" -gt 0 ]; then echo "Aborting..." >&2 - if [ "${BIB2WEB_TMP_DIR}" ] && [ -e "${BIB2WEB_TMP_DIR}" ]; then - cleanUp - fi + cleanUp exit "${result}" fi } diff --git a/bash/src/preprocessor.bash b/bash/src/preprocessor.bash index 2d74e02..b71d2b1 100644 --- a/bash/src/preprocessor.bash +++ b/bash/src/preprocessor.bash @@ -112,6 +112,8 @@ setUpFiles() { # Clean-up cleanUp() { - "${BIB2WEB_RM}" -rf "${BIB2WEB_TMP_DIR}" + if [ "${BIB2WEB_TMP_DIR}" ] && [ -e "${BIB2WEB_TMP_DIR}" ]; then + "${BIB2WEB_RM}" -rf "${BIB2WEB_TMP_DIR}" + fi verbose "Done!" }