File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -94,18 +94,12 @@ 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 ( " \\ " ) || value. contains ( " / " )
102- if !isPath && !value. contains ( " . " ) {
103- value. append ( executableFileSuffix)
104- }
105- #else
10697 guard let value = value, !value. isEmpty else {
10798 return nil
10899 }
100+ #if os(Windows)
101+ let isPath = value. contains ( " : " ) || value. contains ( " \\ " ) || value. contains ( " / " )
102+ #else
109103 let isPath = value. contains ( " / " )
110104#endif
111105
@@ -124,6 +118,11 @@ public func lookupExecutablePath(
124118 if !isPath {
125119 // Try to locate in search paths.
126120 paths. append ( contentsOf: searchPaths. map ( { $0. appending ( component: value) } ) )
121+ #if os(Windows)
122+ if !value. contains ( " . " ) {
123+ paths. append ( contentsOf: searchPaths. map ( { $0. appending ( component: value + executableFileSuffix) } ) )
124+ }
125+ #endif
127126 }
128127
129128 return paths. first ( where: { localFileSystem. isExecutableFile ( $0) } )
You can’t perform that action at this time.
0 commit comments