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(
9494) -> AbsolutePath ? {
9595
9696 // 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
97106 guard let value = value, !value. isEmpty else {
98107 return nil
99108 }
109+ let isPath = value. contains ( " / " )
110+ #endif
100111
101112 var paths : [ AbsolutePath ] = [ ]
102113
@@ -110,7 +121,7 @@ public func lookupExecutablePath(
110121 }
111122
112123 // Ensure the value is not a path.
113- if !value . contains ( " / " ) {
124+ if !isPath {
114125 // Try to locate in search paths.
115126 paths. append ( contentsOf: searchPaths. map ( { $0. appending ( component: value) } ) )
116127 }
You can’t perform that action at this time.
0 commit comments