v.builder: remove temporary file.js file after `v -b js run file.v`

pull/10830/head
Delyan Angelov 2021-07-16 10:03:46 +03:00
parent 0723daf788
commit cbe4ac703e
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 5 additions and 7 deletions

View File

@ -112,11 +112,11 @@ fn (mut b Builder) run_compiled_executable_and_exit() {
if b.pref.is_verbose {
println('============ running $b.pref.out_name ============')
}
exefile := os.real_path(b.pref.out_name)
mut exefile := os.real_path(b.pref.out_name)
mut cmd := '"$exefile"'
if b.pref.backend == .js {
jsfile := os.real_path('${b.pref.out_name}.js')
cmd = 'node "$jsfile"'
exefile = os.real_path('${b.pref.out_name}.js')
cmd = 'node "$exefile"'
}
for arg in b.pref.run_args {
// Determine if there are spaces in the parameters
@ -142,10 +142,8 @@ fn (mut v Builder) cleanup_run_executable_after_exit(exefile string) {
v.pref.vrun_elog('keeping executable: $exefile , because -keepc was passed')
return
}
if os.is_executable(exefile) {
v.pref.vrun_elog('remove run executable: $exefile')
os.rm(exefile) or { panic(err) }
}
v.pref.vrun_elog('remove run executable: $exefile')
os.rm(exefile) or { panic(err) }
}
// 'strings' => 'VROOT/vlib/strings'