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