File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,20 @@ public func lookupExecutablePath(
87
87
) -> AbsolutePath ? {
88
88
89
89
// We should have a value to continue.
90
+ #if os(Windows)
91
+ guard var value = value, !value. isEmpty else {
92
+ return nil
93
+ }
94
+ let isPath = value. contains ( " \\ " )
95
+ if !isPath && value. contains ( " . " ) {
96
+ value. append ( executableFileSuffix)
97
+ }
98
+ #else
90
99
guard let value = value, !value. isEmpty else {
91
100
return nil
92
101
}
102
+ let isPath = value. contains ( " / " )
103
+ #endif
93
104
94
105
var paths : [ AbsolutePath ] = [ ]
95
106
@@ -103,7 +114,7 @@ public func lookupExecutablePath(
103
114
}
104
115
105
116
// Ensure the value is not a path.
106
- if !value . contains ( " / " ) {
117
+ if !isPath {
107
118
// Try to locate in search paths.
108
119
paths. append ( contentsOf: searchPaths. map ( { $0. appending ( component: value) } ) )
109
120
}
You can’t perform that action at this time.
0 commit comments