mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-05 06:03:15 -06:00
try closing it?
This commit is contained in:
parent
af89a69eff
commit
2614aeb181
1 changed files with 7 additions and 2 deletions
|
@ -18,11 +18,16 @@ proc runCmd*(cmd: string): int =
|
|||
|
||||
proc runCmdCapt*(cmd: string): tuple[stdout, stderr: string, exitCode: int] =
|
||||
let args = cmd.splitWhitespace()
|
||||
let p = startProcess(args[0], args = args[1..^1], options = {poUsePath})
|
||||
let p = startProcess(
|
||||
args[0],
|
||||
args = args[1..^1],
|
||||
options = {poUsePath}
|
||||
)
|
||||
p.inputStream.close()
|
||||
let ostrm = outputStream p
|
||||
let errstrm = errorStream p
|
||||
result.exitCode = -1
|
||||
var line = newStringOfCap(120)
|
||||
var line: string
|
||||
while true:
|
||||
if ostrm.readLine(line):
|
||||
result.stdout.add line & '\n'
|
||||
|
|
Loading…
Reference in a new issue