From 8872b0a23b9ac2fb6db2ba0cc72641c1df4259a5 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sun, 27 Dec 2020 17:43:44 +0200 Subject: [PATCH] v.util: fix launch_tool for the vdoc (folder) case --- vlib/v/util/util.v | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vlib/v/util/util.v b/vlib/v/util/util.v index cfce2e6607..b206223b00 100644 --- a/vlib/v/util/util.v +++ b/vlib/v/util/util.v @@ -125,9 +125,15 @@ pub fn launch_tool(is_verbose bool, tool_name string, args []string) { set_vroot_folder(vroot) tool_args := args_quote_paths(args) tool_basename := os.real_path(os.join_path(vroot, 'cmd', 'tools', tool_name)) - tool_exe := if os.is_dir(tool_basename) { path_of_executable(os.join_path(tool_basename, - tool_name)) } else { path_of_executable(tool_basename) } - tool_source := if os.is_dir(tool_basename) { tool_basename } else { tool_basename + '.v' } + mut tool_exe := '' + mut tool_source := '' + if os.is_dir(tool_basename) { + tool_exe = path_of_executable(os.join_path(tool_basename, tool_name)) + tool_source = os.join_path(tool_basename, tool_name + '.v') + } else { + tool_exe = path_of_executable(tool_basename) + tool_source = tool_basename + '.v' + } tool_command := '"$tool_exe" $tool_args' if is_verbose { println('launch_tool vexe : $vroot')