check if latex binary runs

This commit is contained in:
Sina Atalay 2023-10-12 18:18:20 +02:00
parent 4ec486ef6a
commit 06cf9d1198
1 changed files with 14 additions and 8 deletions

View File

@ -392,14 +392,20 @@ def run_latex(latex_file_path):
) )
executable = os.path.join(tinytex_path, "lualatex") executable = os.path.join(tinytex_path, "lualatex")
subprocess.run( try:
[ subprocess.run(
executable, [
f"{latex_file}", executable,
], f"{latex_file}",
cwd=os.path.dirname(latex_file_path), ],
# stdout=subprocess.DEVNULL, # suppress latexmk output 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: # remove the unnecessary files:
for file in os.listdir(os.path.dirname(latex_file_path)): for file in os.listdir(os.path.dirname(latex_file_path)):