summary refs log tree commit diff stats
path: root/koch.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-06-08 12:57:39 +0200
committerAraq <rumpf_a@web.de>2017-06-08 12:57:39 +0200
commit82effc581d956edabed9f0abd68db264b4dcd509 (patch)
treed29b2b5d37d49b15bba1ff6705cdf916cc8c2399 /koch.nim
parentbbf9ef606d08a6ae91fdf1efccd6f37aadc41237 (diff)
downloadNim-82effc581d956edabed9f0abd68db264b4dcd509.tar.gz
added koch xtemp command for easier compiler development
Diffstat (limited to 'koch.nim')
-rw-r--r--koch.nim12
1 files changed, 12 insertions, 0 deletions
diff --git a/koch.nim b/koch.nim
index 743445094..aaa03d558 100644
--- a/koch.nim
+++ b/koch.nim
@@ -470,6 +470,17 @@ proc temp(args: string) =
   copyExe(output, finalDest)
   if programArgs.len > 0: exec(finalDest & " " & programArgs)
 
+proc xtemp(cmd: string) =
+  let d = getAppDir()
+  copyExe(d / "bin" / "nim".exe, d / "bin" / "nim_backup".exe)
+  try:
+    withDir(d):
+      temp"-d:debug"
+    copyExe(d / "bin" / "nim_temp".exe, d / "bin" / "nim".exe)
+    exec(cmd)
+  finally:
+    copyExe(d / "bin" / "nim_backup".exe, d / "bin" / "nim".exe)
+
 proc pushCsources() =
   if not dirExists("../csources/.git"):
     quit "[Error] no csources git repository found"
@@ -545,6 +556,7 @@ of cmdArgument:
   of "testinstall": testUnixInstall()
   of "test", "tests": tests(op.cmdLineRest)
   of "temp": temp(op.cmdLineRest)
+  of "xtemp": xtemp(op.cmdLineRest)
   of "winrelease": winRelease()
   of "wintools": bundleWinTools()
   of "nimble": buildNimble(existsDir(".git"))