Merge pull request #343 from andreaferretti/fix305
Fixed https://github.com/nim-lang/nimble/issues/305
This commit is contained in:
commit
e62084a2a7
2 changed files with 13 additions and 9 deletions
|
|
@ -21,12 +21,16 @@ proc doCmd*(cmd: string, showOutput = false) =
|
||||||
stderr.flushFile()
|
stderr.flushFile()
|
||||||
|
|
||||||
displayDebug("Executing", cmd)
|
displayDebug("Executing", cmd)
|
||||||
|
if showOutput:
|
||||||
|
let exitCode = execCmd(cmd)
|
||||||
|
displayDebug("Finished", "with exit code " & $exitCode)
|
||||||
|
if exitCode != QuitSuccess:
|
||||||
|
raise newException(NimbleError,
|
||||||
|
"Execution failed with exit code $1\nCommand: $2" %
|
||||||
|
[$exitCode, cmd])
|
||||||
|
else:
|
||||||
let (output, exitCode) = execCmdEx(cmd)
|
let (output, exitCode) = execCmdEx(cmd)
|
||||||
displayDebug("Finished", "with exit code " & $exitCode)
|
displayDebug("Finished", "with exit code " & $exitCode)
|
||||||
# TODO: Improve to show output in real-time.
|
|
||||||
if showOutput:
|
|
||||||
display("Output:", output, priority = HighPriority)
|
|
||||||
else:
|
|
||||||
displayDebug("Output", output)
|
displayDebug("Output", output)
|
||||||
|
|
||||||
if exitCode != QuitSuccess:
|
if exitCode != QuitSuccess:
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ test "can use nimscript's setCommand with flags":
|
||||||
let (output, exitCode) = execNimble("--debug", "cr")
|
let (output, exitCode) = execNimble("--debug", "cr")
|
||||||
let lines = output.strip.splitLines()
|
let lines = output.strip.splitLines()
|
||||||
check exitCode == QuitSuccess
|
check exitCode == QuitSuccess
|
||||||
check "Hello World".normalize in lines[^2].normalize
|
check inLines(lines, "Hello World")
|
||||||
|
|
||||||
test "can use nimscript with repeated flags (issue #329)":
|
test "can use nimscript with repeated flags (issue #329)":
|
||||||
cd "nimscript":
|
cd "nimscript":
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue