v up: on windows delete existing v_old.exe before renaming the new v.exe to it

pull/1989/head
Delyan Angelov 2019-09-15 04:33:08 +03:00 committed by Alexander Medvednikov
parent 2eeb4c6153
commit 1d7b9a3b0b
1 changed files with 5 additions and 1 deletions

View File

@ -893,7 +893,11 @@ fn update_v() {
}
println(s.output)
$if windows {
os.mv('$vroot/v.exe', '$vroot/v_old.exe')
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 {
cerror(err)
return