mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-09 08:13:14 -06:00
og impl
This commit is contained in:
parent
46912c29af
commit
b83c345693
1 changed files with 19 additions and 19 deletions
|
@ -24,26 +24,26 @@ proc runCmdCapt*(cmd: string): tuple[stdout, stderr: string, exitCode: int] =
|
||||||
options = {poUsePath}
|
options = {poUsePath}
|
||||||
)
|
)
|
||||||
p.inputStream.close()
|
p.inputStream.close()
|
||||||
let ostrm = outputStream p
|
let outstrm = outputStream p
|
||||||
let errstrm = errorStream p
|
let errstrm = errorStream p
|
||||||
result.exitCode = -1
|
# result.exitCode = -1
|
||||||
var line: string
|
# var line: string
|
||||||
var cnt: int
|
# var cnt: int
|
||||||
while true:
|
# while true:
|
||||||
echo cnt
|
# echo cnt
|
||||||
if ostrm.readLine(line):
|
# if outstrm.readLine(line):
|
||||||
result.stdout.add line & '\n'
|
# result.stdout.add line & '\n'
|
||||||
if errstrm.readLine(line):
|
# if errstrm.readLine(line):
|
||||||
result.stderr.add line & '\n'
|
# result.stderr.add line & '\n'
|
||||||
result.exitCode = peekExitCode(p)
|
# result.exitCode = peekExitCode(p)
|
||||||
if result.exitCode != -1: break
|
# if result.exitCode != -1: break
|
||||||
inc cnt
|
# inc cnt
|
||||||
|
echo "process should have started?"
|
||||||
# result = (
|
result = (
|
||||||
# readAll p.outputStream,
|
readAll outstrm,
|
||||||
# readAll p.errorStream,
|
readAll errstrm,
|
||||||
# waitForExit p
|
waitForExit p
|
||||||
# )
|
)
|
||||||
close p
|
close p
|
||||||
|
|
||||||
proc runCmdCaptWithSpinner*(cmd: string, msg: string = ""): tuple[output, err: string] =
|
proc runCmdCaptWithSpinner*(cmd: string, msg: string = ""): tuple[output, err: string] =
|
||||||
|
|
Loading…
Reference in a new issue