From 06cf9d11988971d7ff57e91c6c96bb5f73695731 Mon Sep 17 00:00:00 2001 From: Sina Atalay Date: Thu, 12 Oct 2023 18:18:20 +0200 Subject: [PATCH] check if latex binary runs --- rendercv/rendering.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/rendercv/rendering.py b/rendercv/rendering.py index 215cbb4..e06ef22 100644 --- a/rendercv/rendering.py +++ b/rendercv/rendering.py @@ -392,14 +392,20 @@ def run_latex(latex_file_path): ) executable = os.path.join(tinytex_path, "lualatex") - subprocess.run( - [ - executable, - f"{latex_file}", - ], - cwd=os.path.dirname(latex_file_path), - # stdout=subprocess.DEVNULL, # suppress latexmk output - ) + try: + subprocess.run( + [ + executable, + f"{latex_file}", + ], + cwd=os.path.dirname(latex_file_path), + check=True, + # stdout=subprocess.DEVNULL, # suppress latexmk output + ) + except subprocess.CalledProcessError as e: + raise RuntimeError( + f"Running TinyTeX has failed with the following error:\n{e.stderr}" + ) # remove the unnecessary files: for file in os.listdir(os.path.dirname(latex_file_path)):