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

tools/fast: improve uploading to gh pages and print errors

This commit is contained in:
Alexander Medvednikov 2021-08-15 09:03:14 +03:00
parent 3ffa6c1664
commit 1bfb525ce1
2 changed files with 13 additions and 9 deletions

View File

@ -47,9 +47,12 @@ fn main() {
// exec('git checkout $commit')
println(' Building vprod...')
os.chdir(vdir)
exec('./v -o vprod -prod -prealloc cmd/v')
if os.args.contains('-noprod') {
exec('./v -o vprod cmd/v') // for faster debugging
} else {
exec('./v -o vprod -prod -prealloc cmd/v')
}
// println('cur vdir="$vdir"')
// exec('v -o vprod cmd/v') // for faster debugging
// cache vlib modules
exec('$vdir/v wipe-cache')
exec('$vdir/v -o v2 -prod cmd/v')
@ -105,6 +108,13 @@ fn main() {
//}
// exec('git checkout master')
// os.write_file('last_commit.txt', commits[commits.len - 1]) ?
// Upload the result to github pages
os.chdir('website')
os.execute_or_exit('git checkout gh-pages')
os.cp('../index.html', 'index.html') ?
os.system('git commit -am "update benchmark"')
os.system('git push origin gh-pages')
os.chdir('..')
}
fn exec(s string) string {

View File

@ -30,13 +30,7 @@ fn main() {
}
if resp.exit_code != 0 {
println('resp != 0, skipping')
} else {
os.chdir('website')
os.execute_or_exit('git checkout gh-pages')
os.cp('../index.html', 'index.html') ?
os.system('git commit -am "update benchmark"')
os.system('git push origin gh-pages')
os.chdir('..')
println(resp.output)
}
time.sleep(180 * time.second)
}