mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-02-02 15:04:18 -06:00
fix stdout/stderr formatting
This commit is contained in:
parent
a259bbc8a7
commit
74a6a2e25c
1 changed files with 10 additions and 15 deletions
|
@ -57,21 +57,16 @@ proc runCmdCapt*(
|
||||||
close p
|
close p
|
||||||
|
|
||||||
proc formatStdoutStderr(stdout: string, stderr: string): string =
|
proc formatStdoutStderr(stdout: string, stderr: string): string =
|
||||||
template addLine =
|
template show(stream: string) =
|
||||||
# TODO: make -> red after hwylterm update
|
if stream.strip() != "":
|
||||||
result.add "-> "
|
result.add astToStr(stream) & ":\n"
|
||||||
result.add line
|
for line in stream.splitlines():
|
||||||
result.add "\n"
|
# TODO: make -> red after hwylterm update
|
||||||
|
result.add "-> "
|
||||||
result.add "stdout:\n"
|
result.add line
|
||||||
for line in stdout.splitLines():
|
result.add "\n"
|
||||||
addLine
|
show(stdout)
|
||||||
|
show(stderr)
|
||||||
result.add "stdout:\n"
|
|
||||||
for line in stderr.splitLines():
|
|
||||||
addLine
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
proc runCmdCaptWithSpinner*(
|
proc runCmdCaptWithSpinner*(
|
||||||
cmd: string,
|
cmd: string,
|
||||||
|
|
Loading…
Reference in a new issue