mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
docgen tests: patch 'nim' commands to use the currently running exe instead
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user