1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

examples: cleanup process_script.v (#18899)

This commit is contained in:
Turiiya 2023-07-18 16:22:26 +02:00 committed by GitHub
parent 6dcf122172
commit 0915d87c7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}')
for cmd.is_alive() {
line = cmd.stdout_read()
println('STDOUT: ${line}')
if !redirect {
line_err = cmd.stderr_read()
println('STDERR: ${line_err}')
}
if !cmd.is_alive() {
break
}
if !redirect {
line_err = cmd.stderr_read()
println('STDERR: ${line_err}')
}
}
if cmd.code > 0 {