summary refs log tree commit diff stats
path: root/koch.nim
diff options
context:
space:
mode:
authorNeelesh Chandola <neelesh.chandola@outlook.com>2018-12-09 15:54:53 +0530
committerNeelesh Chandola <neelesh.chandola@outlook.com>2018-12-09 15:54:53 +0530
commit04a4ff56715aac0e7bef2abe62fa451c7c42d4e9 (patch)
tree3cb4f31e35780da86a18cff809c84b364069844d /koch.nim
parent7a66616d741106d4c18ce2e8f843a8b5d31f6025 (diff)
downloadNim-04a4ff56715aac0e7bef2abe62fa451c7c42d4e9.tar.gz
Fixes #9913
Diffstat (limited to 'koch.nim')
-rw-r--r--koch.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/koch.nim b/koch.nim
index 9a8d38a79..bd10224b6 100644
--- a/koch.nim
+++ b/koch.nim
@@ -79,6 +79,7 @@ template withDir(dir, body) =
   finally:
     setCurrentdir(old)
 
+let origDir = getCurrentDir()
 setCurrentDir(getAppDir())
 
 proc tryExec(cmd: string): bool =
@@ -415,6 +416,7 @@ proc temp(args: string) =
   let nimexec = findNim()
   exec(nimexec & " c -d:debug --debugger:native " & bootArgs & " " & (d / "compiler" / "nim"), 125)
   copyExe(output, finalDest)
+  setCurrentDir(origDir)
   if programArgs.len > 0: exec(finalDest & " " & programArgs)
 
 proc xtemp(cmd: string) =