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

@ -29,10 +29,10 @@ const (
struct Context {
mut:
vgo vgit.VGitOptions
commit_v string = 'master'
vgo vgit.VGitOptions
commit_v string = 'master'
// the commit from which you want to produce a working v compiler (this may be a commit-ish too)
commit_vc string = 'master'
commit_vc string = 'master'
// this will be derived from commit_v
commit_v_hash string // this will be filled from the commit-ish commit_v using rev-list. It IS a commit hash.
path_v string // the full path to the v folder inside workdir.
@ -40,7 +40,7 @@ mut:
cmd_to_run string // the command that you want to run *in* the oldv repo
cc string = 'cc'
// the C compiler to use for bootstrapping.
cleanup bool // should the tool run a cleanup first
cleanup bool // should the tool run a cleanup first
}
fn (mut c Context) compile_oldv_if_needed() {
@ -100,9 +100,7 @@ fn main() {
scripting.cprintln('# v commit hash: $context.commit_v_hash')
scripting.cprintln('# checkout folder: $context.path_v')
if context.cmd_to_run.len > 0 {
cmdres := os.exec(context.cmd_to_run) or {
panic(err)
}
cmdres := os.execute_or_panic(context.cmd_to_run)
scripting.cprintln('# command: ${context.cmd_to_run:-34s} exit code: ${cmdres.exit_code:-4d} result:')
println(cmdres.output)
exit(cmdres.exit_code)