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:
parent
6dcf122172
commit
0915d87c7c
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user