From 87f659a0dc2e13e5c53940c21794ba70bfe77a92 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 21 Oct 2020 15:07:57 +0300 Subject: [PATCH] ci: fix should_recompile_tool/2 --- cmd/tools/vtest-fmt.v | 4 +++- vlib/v/util/util.v | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/tools/vtest-fmt.v b/cmd/tools/vtest-fmt.v index 73f43ab35b..3583d7eacb 100644 --- a/cmd/tools/vtest-fmt.v +++ b/cmd/tools/vtest-fmt.v @@ -67,7 +67,9 @@ fn prepare_vfmt_when_needed() { } fn recompile_file(vexe string, file string) { - recompile_result := os.system('$vexe $file') + cmd := '$vexe $file' + println('recompilation command: $cmd') + recompile_result := os.system(cmd) if recompile_result != 0 { eprintln('could not recompile $file') exit(2) diff --git a/vlib/v/util/util.v b/vlib/v/util/util.v index a70ebda0c6..3200a0a684 100644 --- a/vlib/v/util/util.v +++ b/vlib/v/util/util.v @@ -167,8 +167,8 @@ pub fn launch_tool(is_verbose bool, tool_name string, args []string) { } pub fn should_recompile_tool(vexe string, tool_source string) bool { - sfolder := os.base(tool_source) - tool_name := os.file_name(tool_source).replace('.v', '') + sfolder := os.dir(tool_source) + tool_name := os.base(tool_source).replace('.v', '') tool_exe := os.join_path(sfolder, path_of_executable(tool_name)) // TODO Caching should be done on the `vlib/v` level. mut should_compile := false