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

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

This commit is contained in:
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

View File

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