Skip to content

Commit

Permalink
examples: cleanup process_script.v (#18899)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Jul 18, 2023
1 parent 6dcf122 commit 0915d87
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions examples/process/process_script.v
Expand Up @@ -17,19 +17,13 @@ fn exec(path string, redirect bool) {

cmd.set_redirect_stdio()
cmd.run()
if cmd.is_alive() {
for {
line = cmd.stdout_read()
println('STDOUT: ${line}')

if !redirect {
line_err = cmd.stderr_read()
println('STDERR: ${line_err}')
}

if !cmd.is_alive() {
break
}
for cmd.is_alive() {
line = cmd.stdout_read()
println('STDOUT: ${line}')

if !redirect {
line_err = cmd.stderr_read()
println('STDERR: ${line_err}')
}
}
if cmd.code > 0 {
Expand Down

0 comments on commit 0915d87

Please sign in to comment.