summary refs log tree commit diff stats
path: root/tools/nimweb.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tools/nimweb.nim')
-rw-r--r--tools/nimweb.nim18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/nimweb.nim b/tools/nimweb.nim
index 24ade58fc..6312dace4 100644
--- a/tools/nimweb.nim
+++ b/tools/nimweb.nim
@@ -45,9 +45,10 @@ proc initConfigData(c: var TConfigData) =
   c.gitCommit = "master"
   c.numProcessors = countProcessors()
   # Attempts to obtain the git current commit.
-  let (output, code) = execCmdEx("git log -n 1 --format=%H")
-  if code == 0 and output.strip.len == 40:
-    c.gitCommit = output.strip
+  when false:
+    let (output, code) = execCmdEx("git log -n 1 --format=%H")
+    if code == 0 and output.strip.len == 40:
+      c.gitCommit = output.strip
   c.quotations = initTable[string, tuple[quote, author: string]]()
 
 include "website.tmpl"
@@ -285,8 +286,10 @@ proc buildPdfDoc(c: var TConfigData, destPath: string) =
       exec("pdflatex " & changeFileExt(d, "tex"))
       exec("pdflatex " & changeFileExt(d, "tex"))
       # delete all the crappy temporary files:
-      var pdf = splitFile(d).name & ".pdf"
-      moveFile(dest=destPath / pdf, source=pdf)
+      let pdf = splitFile(d).name & ".pdf"
+      let dest = destPath / pdf
+      removeFile(dest)
+      moveFile(dest=dest, source=pdf)
       removeFile(changeFileExt(pdf, "aux"))
       if existsFile(changeFileExt(pdf, "toc")):
         removeFile(changeFileExt(pdf, "toc"))
@@ -428,4 +431,7 @@ var c: TConfigData
 initConfigData(c)
 parseCmdLine(c)
 parseIniFile(c)
-main(c)
+when false:
+  buildPdfDoc(c, "doc")
+else:
+  main(c)