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