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

compiler: move v up implementation to tools/vup.v

This commit is contained in:
Delyan Angelov
2019-11-01 12:14:59 +02:00
committed by Alexander Medvednikov
parent 15f971ece7
commit e15abb3de0
4 changed files with 26 additions and 29 deletions

View File

@@ -978,34 +978,6 @@ pub fn env_vflags_and_os_args() []string {
return args
}
pub fn update_v() {
println('Updating V...')
vroot := os.dir(vexe_path())
s := os.exec('git -C "$vroot" pull --rebase origin master') or {
verror(err)
return
}
println(s.output)
$if windows {
v_backup_file := '$vroot/v_old.exe'
if os.file_exists( v_backup_file ) {
os.rm( v_backup_file )
}
os.mv('$vroot/v.exe', v_backup_file)
s2 := os.exec('"$vroot/make.bat"') or {
verror(err)
return
}
println(s2.output)
} $else {
s2 := os.exec('make -C "$vroot"') or {
verror(err)
return
}
println(s2.output)
}
}
pub fn vfmt(args[]string) {
file := args.last()
if !os.file_exists(file) {