From 23c323ea1df6a3db2c8c219b298cc18752d32829 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 18 Sep 2018 12:20:58 +0200 Subject: [PATCH] docgen tests: patch 'nim' commands to use the currently running exe instead --- compiler/docgen.nim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/compiler/docgen.nim b/compiler/docgen.nim index e7920ad066..83dd5de2a2 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -976,10 +976,12 @@ proc commandRstAux(cache: IdentCache, conf: ConfigRef; # Nim's convention: every path is relative to the file it was written in: outp = splitFile(d.filename).dir.AbsoluteDir / RelativeFile(filename) writeFile(outp, content) - let cmd = cmd % quoteShell(outp) - rawMessage(conf, hintExecuting, cmd) - if execShellCmd(cmd) != status: - rawMessage(conf, errGenerated, "executing of external program failed: " & cmd) + let c = if cmd.startsWith("nim "): os.getAppFilename() & cmd.substr(3) + else: cmd + let c2 = c % quoteShell(outp) + rawMessage(conf, hintExecuting, c2) + if execShellCmd(c2) != status: + rawMessage(conf, errGenerated, "executing of external program failed: " & c2) d.isPureRst = true var rst = parseRst(readFile(filen.string), filen.string, 0, 1, d.hasToc,