successX now correctly shows html output for nim doc, nim jsondoc; fix #13121 (#13116)

* successX now correctly shows html output for nim doc
* fixes #13121
* fixup hintSuccessX to be less weird
This commit is contained in:
Timothee Cour 2020-01-15 06:18:37 -08:00 • committed by Andreas Rumpf
commit d88b52c0bc
5 changed files with 18 additions and 6 deletions

View file

@ -54,8 +54,19 @@ when true:
proc `==`*[T: AnyPath](x, y: T): bool = eqImpl(x.string, y.string)
template postProcessBase(base: AbsoluteDir): untyped =
# xxx: as argued here https://github.com/nim-lang/Nim/pull/10018#issuecomment-448192956
# empty paths should not mean `cwd` so the correct behavior would be to throw
# here and make sure `outDir` is always correctly initialized; for now
# we simply preserve pre-existing external semantics and treat it as `cwd`
when false:
doAssert isAbsolute(base.string), base.string
base
else:
if base.isEmpty: getCurrentDir().AbsoluteDir else: base
proc `/`*(base: AbsoluteDir; f: RelativeFile): AbsoluteFile =
#assert isAbsolute(base.string)
let base = postProcessBase(base)
assert(not isAbsolute(f.string))
result = AbsoluteFile newStringOfCap(base.string.len + f.string.len)
var state = 0
@ -63,7 +74,7 @@ when true:
addNormalizePath(f.string, result.string, state)
proc `/`*(base: AbsoluteDir; f: RelativeDir): AbsoluteDir =
#assert isAbsolute(base.string)
let base = postProcessBase(base)
assert(not isAbsolute(f.string))
result = AbsoluteDir newStringOfCap(base.string.len + f.string.len)
var state = 0