vup: do v self then make.bat on Windows (#6219)

pull/6221/head
JalonSolov 2020-08-25 12:12:53 -04:00 committed by GitHub
parent cc82ed28f8
commit 45505a8423
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 16 deletions

View File

@ -42,26 +42,24 @@ fn main() {
app.show_current_v_version() app.show_current_v_version()
return return
} }
mut vself := 'v self'
mut make := 'make'
$if windows { $if windows {
app.backup('v.exe') vself = 'v.exe self'
make_result := os.exec('make.bat') or { make = 'make.bat'
app.backup('cmd/tools/vup.exe')
}
self_result := os.exec(vself) or {
panic(err)
}
println(self_result.output)
if self_result.exit_code != 0 {
// v self failed, have to use make
println('v self failed, running make...')
make_result := os.exec(make) or {
panic(err) panic(err)
} }
println(make_result.output) println(make_result.output)
app.backup('cmd/tools/vup.exe')
} $else {
self_result := os.exec('./v self') or {
panic(err)
}
println(self_result.output)
if self_result.exit_code != 0 {
// v self failed, have to use make
println('v self failed, running make...')
make_result := os.exec('make') or {
panic(err)
}
println(make_result.output)
}
} }
os.exec('v cmd/tools/vup.v') or { os.exec('v cmd/tools/vup.v') or {
panic(err) panic(err)