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 @@ -224,6 +224,11 @@ public func lookupExecutablePath(
224
224
guard let value = value, !value. isEmpty else {
225
225
return nil
226
226
}
227
+ #if os(Windows)
228
+ let isPath = value. contains ( " : " ) || value. contains ( " \\ " ) || value. contains ( " / " )
229
+ #else
230
+ let isPath = value. contains ( " / " )
231
+ #endif
227
232
228
233
var paths : [ AbsolutePath ] = [ ]
229
234
@@ -237,9 +242,14 @@ public func lookupExecutablePath(
237
242
}
238
243
239
244
// Ensure the value is not a path.
240
- if !value . contains ( " / " ) {
245
+ if !isPath {
241
246
// Try to locate in search paths.
242
247
paths. append ( contentsOf: searchPaths. map ( { $0. appending ( component: value) } ) )
248
+ #if os(Windows)
249
+ if !value. contains ( " . " ) {
250
+ paths. append ( contentsOf: searchPaths. map ( { $0. appending ( component: value + executableFileSuffix) } ) )
251
+ }
252
+ #endif
243
253
}
244
254
245
255
return paths. first ( where: { localFileSystem. isExecutableFile ( $0) } )
You can’t perform that action at this time.
0 commit comments