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 @@ -87,9 +87,20 @@ public func lookupExecutablePath(
8787) -> AbsolutePath ? {
8888
8989 // 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
9099 guard let value = value, !value. isEmpty else {
91100 return nil
92101 }
102+ let isPath = value. contains ( " / " )
103+ #endif
93104
94105 var paths : [ AbsolutePath ] = [ ]
95106
@@ -103,7 +114,7 @@ public func lookupExecutablePath(
103114 }
104115
105116 // Ensure the value is not a path.
106- if !value . contains ( " / " ) {
117+ if !isPath {
107118 // Try to locate in search paths.
108119 paths. append ( contentsOf: searchPaths. map ( { $0. appending ( component: value) } ) )
109120 }
You can’t perform that action at this time.
0 commit comments