ci: fix should_recompile_tool/2

pull/6665/head
Delyan Angelov 2020-10-21 15:07:57 +03:00
parent 5e523fd03a
commit 87f659a0dc
2 changed files with 5 additions and 3 deletions

View File

@ -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)

View File

@ -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