summary refs log tree commit diff stats
path: root/koch.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-01-15 22:57:50 +0100
committerAraq <rumpf_a@web.de>2019-01-15 22:57:50 +0100
commitef769e20b3b53de4a6940ae5cbc6751647e402f7 (patch)
tree024128f49ce7817aa9dea7661b993bb02897f766 /koch.nim
parent27e366eaec3389c11889375759e682d70b9cf5b6 (diff)
downloadNim-ef769e20b3b53de4a6940ae5cbc6751647e402f7.tar.gz
attempt to fix https://github.com/nim-lang/nightlies/issues/17
Diffstat (limited to 'koch.nim')
-rw-r--r--koch.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/koch.nim b/koch.nim
index 5e9537607..b50b6c0e1 100644
--- a/koch.nim
+++ b/koch.nim
@@ -74,7 +74,8 @@ Web options:
                            build the official docs, use UA-48159761-1
 """
 
-let kochExe* = os.getAppFilename()
+let kochExe* = when isMainModule: os.getAppFilename() # always correct when koch is main program, even if `koch` exe renamed eg: `nim c -o:koch_debug koch.nim`
+               else: getAppDir() / "koch " # `best effort`, works for ur particular use case in nightly
 
 proc kochExec*(cmd: string) =
   exec kochExe.quoteShell & " " & cmd