Show output for the compiler/docgen commands. Fixes #303.
This commit is contained in:
parent
dda0c39e34
commit
0628911758
2 changed files with 6 additions and 3 deletions
|
|
@ -657,7 +657,7 @@ proc execBackend(options: Options) =
|
|||
display("Generating", ("documentation for $1 (from package $2) using $3 " &
|
||||
"backend") % [bin, pkgInfo.name, backend], priority = HighPriority)
|
||||
doCmd("\"" & getNimBin() & "\" $# --noNimblePath $# \"$#\"" %
|
||||
[backend, args, bin])
|
||||
[backend, args, bin], showOutput = true)
|
||||
display("Success:", "Execution finished", Success, HighPriority)
|
||||
|
||||
proc search(options: Options) =
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ proc extractBin(cmd: string): string =
|
|||
else:
|
||||
return cmd.split(' ')[0]
|
||||
|
||||
proc doCmd*(cmd: string) =
|
||||
proc doCmd*(cmd: string, showOutput = false) =
|
||||
let bin = extractBin(cmd)
|
||||
if findExe(bin) == "":
|
||||
raise newException(NimbleError, "'" & bin & "' not in PATH.")
|
||||
|
|
@ -24,7 +24,10 @@ proc doCmd*(cmd: string) =
|
|||
let (output, exitCode) = execCmdEx(cmd)
|
||||
displayDebug("Finished", "with exit code " & $exitCode)
|
||||
# TODO: Improve to show output in real-time.
|
||||
displayDebug("Output", output)
|
||||
if showOutput:
|
||||
display("Output:", output, priority = HighPriority)
|
||||
else:
|
||||
displayDebug("Output", output)
|
||||
|
||||
if exitCode != QuitSuccess:
|
||||
raise newException(NimbleError,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue