Skip to content

Commit

Permalink
fix nim-lang#6583 nim doc now outputs again in $projdir, like the oth…
Browse files Browse the repository at this point in the history
…er commands
  • Loading branch information
timotheecour committed May 12, 2020
1 parent 06dfd31 commit 3cb2d55
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ proc mydiv(a, b): int {.raises: [].} =
(likewise with other hints and warnings), which is consistent with all other bool flags.
(since 1.3.3).
- `nim doc -r main` and `nim rst2html -r main` now call openDefaultBrowser
- `nim doc foo/main` now outputs to `foo/main.html`, consistently with other commands. Use
`--usenimcache` for example to output instead under $nimcache.

## Tool changes

5 changes: 1 addition & 4 deletions compiler/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,7 @@ proc mainCommand*(graph: ModuleGraph) =
conf.searchPaths.add(conf.libpath)
setId(100)

## Calling `setOutDir(conf)` unconditionally would fix regression
## https://github.com/nim-lang/Nim/issues/6583#issuecomment-625711125
when false: setOutDir(conf)
if optUseNimcache in conf.globalOptions: setOutDir(conf)
setOutDir(conf)

template handleBackend(backend2: TBackend) =
conf.backend = backend2
Expand Down
1 change: 1 addition & 0 deletions compiler/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ proc getOutFile*(conf: ConfigRef; filename: RelativeFile, ext: string): Absolute
# explains regression https://github.com/nim-lang/Nim/issues/6583#issuecomment-625711125
# Yet another reason why "" should not mean "."; `""/something` should raise
# instead of implying "" == "." as it's bug prone.
doAssert conf.outDir.string.len > 0
result = conf.outDir / changeFileExt(filename, ext)

proc absOutFile*(conf: ConfigRef): AbsoluteFile =
Expand Down

0 comments on commit 3cb2d55

Please sign in to comment.