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")
try:
subprocess.run( subprocess.run(
[ [
executable, executable,
f"{latex_file}", f"{latex_file}",
], ],
cwd=os.path.dirname(latex_file_path), cwd=os.path.dirname(latex_file_path),
check=True,
# stdout=subprocess.DEVNULL, # suppress latexmk output # 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)):