2019-12-23 11:22:06 +01:00
|
|
|
module main
|
|
|
|
|
2019-12-23 11:09:22 +01:00
|
|
|
import (
|
|
|
|
os
|
|
|
|
filepath
|
2020-02-20 17:41:55 +01:00
|
|
|
v.pref
|
2019-12-23 11:09:22 +01:00
|
|
|
)
|
2019-11-01 11:14:59 +01:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println('Updating V...')
|
2020-02-20 17:41:55 +01:00
|
|
|
vroot := filepath.dir(pref.vexe_path())
|
2019-11-01 11:14:59 +01:00
|
|
|
os.chdir(vroot)
|
2020-02-20 17:41:55 +01:00
|
|
|
// git pull
|
|
|
|
s := os.exec('git pull --rebase origin master') or {
|
|
|
|
panic(err)
|
|
|
|
}
|
2019-11-01 11:14:59 +01:00
|
|
|
println(s.output)
|
2020-02-20 17:41:55 +01:00
|
|
|
|
2019-11-01 11:14:59 +01:00
|
|
|
$if windows {
|
2020-02-20 17:41:55 +01:00
|
|
|
v_backup_file := 'v_old.exe'
|
|
|
|
if os.exists(v_backup_file) {
|
|
|
|
os.rm(v_backup_file)
|
|
|
|
}
|
|
|
|
os.mv('v.exe', v_backup_file)
|
|
|
|
|
|
|
|
s2 := os.exec('make.bat') or {
|
|
|
|
panic(err)
|
2019-11-01 11:14:59 +01:00
|
|
|
}
|
|
|
|
println(s2.output)
|
|
|
|
} $else {
|
2020-02-20 17:41:55 +01:00
|
|
|
s2 := os.exec('make') or {
|
|
|
|
panic(err)
|
|
|
|
}
|
2019-11-01 11:14:59 +01:00
|
|
|
println(s2.output)
|
|
|
|
}
|
|
|
|
}
|