File tree Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Expand file tree Collapse file tree 1 file changed +3
-19
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,9 @@ pub fn find_working_diff_command() !string {
19
19
'code' , 'code.cmd' ]
20
20
// NOTE: code.cmd is the Windows variant of the `code` cli tool
21
21
for diffcmd in known_diff_tools {
22
- if diffcmd == 'opendiff' { // opendiff has no `--version` option
23
- if opendiff_exists () {
24
- return diffcmd
25
- }
26
- continue
22
+ if diffcmd == 'opendiff' {
23
+ os.find_abs_path_of_executable ('opendiff' ) or { continue }
24
+ return diffcmd
27
25
}
28
26
$if freebsd || openbsd {
29
27
if diffcmd == 'diff' { // FreeBSD/OpenBSD diff have no `--version` option
@@ -51,20 +49,6 @@ pub fn find_working_diff_command() !string {
51
49
return error ('No working "diff" command found' )
52
50
}
53
51
54
- // determine if the FileMerge opendiff tool is available
55
- fn opendiff_exists () bool {
56
- o := os.execute ('opendiff' )
57
- if o.exit_code < 0 {
58
- return false
59
- }
60
- if o.exit_code == 1 { // failed (expected), but found (i.e. not 127)
61
- if o.output.contains ('too few arguments' ) { // got some expected output
62
- return true
63
- }
64
- }
65
- return false
66
- }
67
-
68
52
pub fn color_compare_files (diff_cmd string , file1 string , file2 string ) string {
69
53
if diff_cmd != '' {
70
54
mut full_cmd := '${diff_cmd} --minimal --text --unified=2 --show-function-line="fn " ${os.quoted_path(file1)} ${os.quoted_path(file2)} '
You can’t perform that action at this time.
0 commit comments