From 5c29a7ef7dc4fc6f59157304c0791bc5de7005bd Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Fri, 9 Aug 2019 23:37:31 +0300 Subject: [PATCH] v run: windows and repl fixes --- compiler/main.v | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/compiler/main.v b/compiler/main.v index 21ccc0d439..b9f15db7bc 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -197,13 +197,9 @@ fn main() { } if 'run' in args { - vsource := v.dir - vtarget := final_target_out_name( v.out_name ) - if os.file_exists(vtarget) && ( os.file_last_mod_unix(vsource) <= os.file_last_mod_unix(vtarget) ) { - //println('ALREADY BUILD FROM vsource: $vsource | vtarget: $vtarget') - v.run_compiled_executable_and_exit() - } - v.compile() + // always recompile for now, too error prone to skip recompilation otherwise + // for example for -repl usage, especially when piping lines to v + v.compile() v.run_compiled_executable_and_exit() } @@ -646,6 +642,7 @@ fn final_target_out_name(out_name string) string { $if windows { cmd = out_name cmd = cmd.replace('/', '\\') + cmd += '.exe' } return cmd } @@ -654,7 +651,7 @@ fn (v V) run_compiled_executable_and_exit() { if v.pref.is_verbose { println('============ running $v.out_name ============') } - mut cmd := final_target_out_name(v.out_name) + mut cmd := final_target_out_name(v.out_name).replace('.exe','') if os.args.len > 3 { cmd += ' ' + os.args.right(3).join(' ') }