From 27f631cc2bbd14099c13303994e6eb636d535c42 Mon Sep 17 00:00:00 2001 From: joachimschmidt557 Date: Thu, 25 Jul 2019 17:43:33 +0200 Subject: [PATCH] Individually cached tex and pdf files --- src/etherpad2latex.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/etherpad2latex.nim b/src/etherpad2latex.nim index a2d87df..c6342be 100644 --- a/src/etherpad2latex.nim +++ b/src/etherpad2latex.nim @@ -19,14 +19,14 @@ when isMainModule: let pad = @"pad" content = getContent(pad, etherpadUrl) - texFile = open("etherpad.tex", fmWrite) + texFile = open(pad & ".tex", fmWrite) texFile.write(content) texFile.close() - let (output, exitCode) = execCmdEx(quoteShellCommand(["pdflatex", "-halt-on-error", "etherpad.tex"])) + let (output, exitCode) = execCmdEx(quoteShellCommand(["pdflatex", "-halt-on-error", pad & ".tex"])) if exitCode == 0: - resp(Http200, readFile("etherpad.pdf"), contentType = "application/pdf") + resp(Http200, readFile(pad & ".pdf"), contentType = "application/pdf") else: resp output