summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBinHong Lee <binhonglee@users.noreply.github.com>2020-01-05 10:24:30 -0800
committerAndreas Rumpf <rumpf_a@web.de>2020-01-05 19:24:29 +0100
commit2cfa8d838590d8e6a2df42591f6887a9817be74d (patch)
treeab52a824bfd1fe774a4139fd266176635d6de25f
parent9a5aaadda82c5e33d481097c9c15b9c8e54e34c5 (diff)
downloadNim-2cfa8d838590d8e6a2df42591f6887a9817be74d.tar.gz
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.
-rw-r--r--compiler/docgen.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index f75c16d02..5eaaed120 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -1168,6 +1168,9 @@ proc commandBuildIndex*(cache: IdentCache, conf: ConfigRef) =
       ["Index".rope, nil, nil, rope(getDateStr()),
                    rope(getClockStr()), content, nil, nil, nil])
   # no analytics because context is not available
-  let filename = getOutFile(conf, RelativeFile"theindex", HtmlExt)
+  var outFile = RelativeFile"theindex"
+  if conf.outFile != RelativeFile"":
+    outFile = conf.outFile
+  let filename = getOutFile(conf, outFile, HtmlExt)
   if not writeRope(code, filename):
     rawMessage(conf, errCannotOpenFile, filename.string)
40' href='#n140'>140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254