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

os: deprecate os.exec (returning ?os.Result), in favour of os.execute, which returns os.Result (#8974)

This commit is contained in:
Delyan Angelov
2021-03-08 20:52:13 +02:00
committed by GitHub
parent 10c9f61d61
commit d7049ae2da
52 changed files with 423 additions and 344 deletions

View File

@ -287,7 +287,8 @@ fn worker_trunner(mut p pool.PoolProcessor, idx int, thread_id int) voidptr {
if testing.show_start {
ts.append_message(.info, ' starting $relative_file ...')
}
r := os.exec(cmd) or {
r := os.execute(cmd)
if r.exit_code < 0 {
ts.failed = true
ts.benchmark.fail()
tls_bench.fail()
@ -387,7 +388,10 @@ pub fn v_build_failing_skipped(zargs string, folder string, oskipped []string) b
}
pub fn build_v_cmd_failed(cmd string) bool {
res := os.exec(cmd) or { return true }
res := os.execute(cmd)
if res.exit_code < 0 {
return true
}
if res.exit_code != 0 {
eprintln('')
eprintln(res.output)