1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/tools/vup.v
2019-12-24 05:44:22 +03:00

27 lines
557 B
V

module main
import (
os
filepath
)
fn main() {
println('Updating V...')
vroot := filepath.dir(os.getenv('VEXE'))
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'
if os.exists( v_backup_file ) {
os.rm( v_backup_file )
}
os.mv('$vroot/v.exe', v_backup_file)
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)
}
}