2019-12-23 11:22:06 +01:00
|
|
|
module main
|
|
|
|
|
2019-12-23 11:09:22 +01:00
|
|
|
import (
|
|
|
|
os
|
|
|
|
filepath
|
|
|
|
)
|
2019-11-01 11:14:59 +01:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println('Updating V...')
|
2019-12-24 03:44:22 +01:00
|
|
|
vroot := filepath.dir(os.getenv('VEXE'))
|
2019-11-01 11:14:59 +01:00
|
|
|
os.chdir(vroot)
|
|
|
|
s := os.exec('git -C "$vroot" pull --rebase origin master') or { panic(err) }
|
|
|
|
println(s.output)
|
|
|
|
$if windows {
|
|
|
|
v_backup_file := '$vroot/v_old.exe'
|
2019-12-04 21:03:12 +01:00
|
|
|
if os.exists( v_backup_file ) {
|
2019-11-01 11:14:59 +01:00
|
|
|
os.rm( v_backup_file )
|
|
|
|
}
|
2019-12-23 11:22:06 +01:00
|
|
|
os.mv('$vroot/v.exe', v_backup_file)
|
2019-11-01 11:14:59 +01:00
|
|
|
s2 := os.exec('"$vroot/make.bat"') or { panic(err) }
|
|
|
|
println(s2.output)
|
|
|
|
} $else {
|
|
|
|
s2 := os.exec('make -C "$vroot"') or { panic(err) }
|
|
|
|
println(s2.output)
|
|
|
|
}
|
|
|
|
}
|