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

vup: fix unnecessary recompiles

fixes #4441
This commit is contained in:
JalonSolov 2020-04-22 13:54:39 -04:00 committed by GitHub
parent de182d5809
commit 54c382f6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,20 +36,30 @@ fn main() {
}
$if windows {
v_backup_file := 'v_old.exe'
if os.exists(v_backup_file) {
os.rm(v_backup_file)
}
os.mv('v.exe', v_backup_file)
backup('v.exe')
make_result := os.exec('make.bat') or {
panic(err)
}
println(make_result.output)
backup('cmd/tools/vup.exe')
} $else {
make_result := os.exec('make') or {
panic(err)
}
println(make_result.output)
}
_ := os.exec('v cmd/tools/vup') or {
panic(err)
}
}
fn backup(file string) {
backup_file := '${file}_old.exe'
if os.exists(backup_file) {
os.rm(backup_file)
}
os.mv(file, backup_file)
}