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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 423 additions and 344 deletions

View file

@ -211,7 +211,10 @@ fn (mut f MDFile) debug() {
}
fn cmdexecute(cmd string) int {
res := os.exec(cmd) or { return 1 }
res := os.execute(cmd)
if res.exit_code < 0 {
return 1
}
if res.exit_code != 0 {
eprint(res.output)
}
@ -219,7 +222,7 @@ fn cmdexecute(cmd string) int {
}
fn silent_cmdexecute(cmd string) int {
res := os.exec(cmd) or { return 1 }
res := os.execute(cmd)
return res.exit_code
}