v: make launch_tool use .exe extension on windows

pull/3792/head
Delyan Angelov 2020-02-20 11:56:13 +02:00 committed by GitHub
parent aab1045045
commit 05329d6731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -20,7 +20,7 @@ fn launch_tool(is_verbose bool, tname string, cmdname string) {
}
mut compilation_options := os.args[1..tname_index].clone()
tool_args := os.args[1..].join(' ')
tool_exe := os.realpath('$vroot/cmd/tools/$tname')
tool_exe := path_of_executable(os.realpath('$vroot/cmd/tools/$tname'))
tool_source := os.realpath('$vroot/cmd/tools/${tname}.v')
tool_command := '"$tool_exe" $tool_args'
if is_verbose {
@ -68,3 +68,10 @@ fn launch_tool(is_verbose bool, tname string, cmdname string) {
exit(os.system(tool_command))
}
fn path_of_executable(path string) string {
$if windows {
return path + '.exe'
}
return path
}