File tree 1 file changed +11
-1
lines changed 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,11 @@ public func lookupExecutablePath(
97
97
guard let value = value, !value. isEmpty else {
98
98
return nil
99
99
}
100
+ #if os(Windows)
101
+ let isPath = value. contains ( " : " ) || value. contains ( " \\ " ) || value. contains ( " / " )
102
+ #else
103
+ let isPath = value. contains ( " / " )
104
+ #endif
100
105
101
106
var paths : [ AbsolutePath ] = [ ]
102
107
@@ -110,9 +115,14 @@ public func lookupExecutablePath(
110
115
}
111
116
112
117
// Ensure the value is not a path.
113
- if !value . contains ( " / " ) {
118
+ if !isPath {
114
119
// Try to locate in search paths.
115
120
paths. append ( contentsOf: searchPaths. map ( { $0. appending ( component: value) } ) )
121
+ #if os(Windows)
122
+ if !value. contains ( " . " ) {
123
+ paths. append ( contentsOf: searchPaths. map ( { $0. appending ( component: value + executableFileSuffix) } ) )
124
+ }
125
+ #endif
116
126
}
117
127
118
128
return paths. first ( where: { localFileSystem. isExecutableFile ( $0) } )
You can’t perform that action at this time.
0 commit comments