From ef769e20b3b53de4a6940ae5cbc6751647e402f7 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 15 Jan 2019 22:57:50 +0100 Subject: [PATCH] attempt to fix https://github.com/nim-lang/nightlies/issues/17 --- koch.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koch.nim b/koch.nim index 5e95376074..b50b6c0e13 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