1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: add support for VDIFF_TOOL, detect more diffing tools (#5857)

This commit is contained in:
Ryan Willis
2020-07-17 04:03:07 -07:00
committed by GitHub
parent f6947d111b
commit e804ba5294
8 changed files with 144 additions and 87 deletions

View File

@@ -265,8 +265,9 @@ pub fn exec(cmd string) ?Result {
C.ExpandEnvironmentStringsW(cmd.to_wide(), voidptr(&command_line), 32768)
create_process_ok := C.CreateProcessW(0, command_line, 0, 0, C.TRUE, 0, 0, 0, voidptr(&start_info), voidptr(&proc_info))
if !create_process_ok {
error_msg := get_error_msg(int(C.GetLastError()))
return error('exec failed (CreateProcess): $error_msg cmd: $cmd')
error_num := int(C.GetLastError())
error_msg := get_error_msg(error_num)
return error('exec failed (CreateProcess) with code $error_num: $error_msg cmd: $cmd')
}
C.CloseHandle(child_stdin)
C.CloseHandle(child_stdout_write)