Skip to content

Commit 2cfa8d8

Browse files
binhongleeAraq
authored andcommitted
Allow -o option for buildIndex (#13037) [backport]
Addressing #12771 This is also included in the docgen documentation [here](https://nim-lang.org/docs/docgen.html) but its not respected as reported in the issue.
1 parent 9a5aaad commit 2cfa8d8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/docgen.nim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1168,6 +1168,9 @@ proc commandBuildIndex*(cache: IdentCache, conf: ConfigRef) =
11681168
["Index".rope, nil, nil, rope(getDateStr()),
11691169
rope(getClockStr()), content, nil, nil, nil])
11701170
# no analytics because context is not available
1171-
let filename = getOutFile(conf, RelativeFile"theindex", HtmlExt)
1171+
var outFile = RelativeFile"theindex"
1172+
if conf.outFile != RelativeFile"":
1173+
outFile = conf.outFile
1174+
let filename = getOutFile(conf, outFile, HtmlExt)
11721175
if not writeRope(code, filename):
11731176
rawMessage(conf, errCannotOpenFile, filename.string)

0 commit comments

Comments
 (0)