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,18 +21,22 @@ proc doCmd*(cmd: string, showOutput = false) =
|
|||
stderr.flushFile()
|
||||
|
||||
displayDebug("Executing", cmd)
|
||||
let (output, exitCode) = execCmdEx(cmd)
|
||||
displayDebug("Finished", "with exit code " & $exitCode)
|
||||
# TODO: Improve to show output in real-time.
|
||||
if showOutput:
|
||||
display("Output:", output, priority = HighPriority)
|
||||
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)
|
||||
displayDebug("Finished", "with exit code " & $exitCode)
|
||||
displayDebug("Output", output)
|
||||
|
||||
if exitCode != QuitSuccess:
|
||||
raise newException(NimbleError,
|
||||
"Execution failed with exit code $1\nCommand: $2\nOutput: $3" %
|
||||
[$exitCode, cmd, output])
|
||||
if exitCode != QuitSuccess:
|
||||
raise newException(NimbleError,
|
||||
"Execution failed with exit code $1\nCommand: $2\nOutput: $3" %
|
||||
[$exitCode, cmd, output])
|
||||
|
||||
proc doCmdEx*(cmd: string): tuple[output: TaintedString, exitCode: int] =
|
||||
let bin = extractBin(cmd)
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ test "can use nimscript's setCommand with flags":
|
|||
let (output, exitCode) = execNimble("--debug", "cr")
|
||||
let lines = output.strip.splitLines()
|
||||
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)":
|
||||
cd "nimscript":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue