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:
@ -50,7 +50,7 @@ fn main() {
|
||||
date := time.unix(commit_date.int())
|
||||
mut out := os.create('table.html') ?
|
||||
// Place the new row on top
|
||||
table =
|
||||
table =
|
||||
'<tr>
|
||||
<td>$date.format()</td>
|
||||
<td><a target=_blank href="https://github.com/vlang/v/commit/$commit">$commit</a></td>
|
||||
@ -81,7 +81,7 @@ fn main() {
|
||||
}
|
||||
|
||||
fn exec(s string) string {
|
||||
e := os.exec(s) or { panic(err) }
|
||||
e := os.execute_or_panic(s)
|
||||
return e.output.trim_right('\r\n')
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ fn measure(cmd string, description string) int {
|
||||
}
|
||||
|
||||
fn measure_steps(vdir string) (int, int, int) {
|
||||
resp := os.exec('$vdir/vprod -o v.c -show-timings $vdir/cmd/v') or { panic(err) }
|
||||
resp := os.execute_or_panic('$vdir/vprod -o v.c -show-timings $vdir/cmd/v')
|
||||
lines := resp.output.split_into_lines()
|
||||
if lines.len != 3 {
|
||||
return 0, 0, 0
|
||||
|
@ -17,20 +17,22 @@ fn main() {
|
||||
return
|
||||
}
|
||||
for {
|
||||
os.exec('git pull --rebase') or {
|
||||
res_pull := os.execute('git pull --rebase')
|
||||
if res_pull.exit_code != 0 {
|
||||
println('failed to git pull. uncommitted changes?')
|
||||
return
|
||||
}
|
||||
// println('running fast')
|
||||
resp := os.exec('./fast') or {
|
||||
println(err)
|
||||
resp := os.execute('./fast')
|
||||
if resp.exit_code < 0 {
|
||||
println(resp.output)
|
||||
return
|
||||
}
|
||||
if resp.exit_code != 0 {
|
||||
println('resp != 0, skipping')
|
||||
} else {
|
||||
os.chdir('website')
|
||||
os.exec('git checkout gh-pages') ?
|
||||
os.execute_or_panic('git checkout gh-pages')
|
||||
os.cp('../index.html', 'index.html') ?
|
||||
os.system('git commit -am "update benchmark"')
|
||||
os.system('git push origin gh-pages')
|
||||
|
Reference in New Issue
Block a user