partially fix #8218: nim doc --project (#8737)

This commit is contained in:
Timothee Cour
2018-08-23 01:18:10 -07:00
committed by Andreas Rumpf
parent b02bc66197
commit 52bee6baba

View File

@@ -787,14 +787,13 @@ proc getOutFile2(conf: ConfigRef; filename, ext, dir: string): string =
proc writeOutput*(d: PDoc, filename, outExt: string, useWarning = false) =
var content = genOutFile(d)
var success = true
if optStdout in d.conf.globalOptions:
writeRope(stdout, content)
else:
let outfile = getOutFile2(d.conf, filename, outExt, "htmldocs")
success = writeRope(content, outfile)
if not success:
rawMessage(d.conf, if useWarning: warnCannotOpenFile else: errCannotOpenFile, filename)
createDir(outfile.parentDir)
if not writeRope(content, outfile):
rawMessage(d.conf, if useWarning: warnCannotOpenFile else: errCannotOpenFile, outfile)
proc writeOutputJson*(d: PDoc, filename, outExt: string,
useWarning = false) =