From 52bee6baba1b5aeb5abe763c06478cd3139a5a84 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Thu, 23 Aug 2018 01:18:10 -0700 Subject: [PATCH] partially fix #8218: nim doc --project (#8737) --- compiler/docgen.nim | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/docgen.nim b/compiler/docgen.nim index b35452365b..3842f0ad4e 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -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) =