File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 30
30
if case . subcommand( let subcommand) = mode {
31
31
// We are running as a subcommand, try to find the subcommand adjacent to the executable we are running as.
32
32
// If we didn't find the tool there, let the OS search for it.
33
- let subcommandPath = Process . findExecutable ( arguments [ 0 ] ) ? . parentDirectory. appending ( component: subcommand)
34
- ?? Process . findExecutable ( subcommand)
33
+ #if os(Windows)
34
+ let filename = subcommand + " .exe "
35
+ #else
36
+ let filename = subcommand
37
+ #endif
38
+ let subcommandPath = Process . findExecutable ( arguments [ 0 ] ) ? . parentDirectory. appending ( component: filename)
39
+ ?? Process . findExecutable ( filename)
35
40
36
41
if subcommandPath == nil || !localFileSystem. exists ( subcommandPath!) {
37
- fatalError ( " cannot find subcommand executable ' \( subcommand ) ' " )
42
+ fatalError ( " cannot find subcommand executable ' \( filename ) ' " )
38
43
}
39
44
40
45
// Execute the subcommand.
You can’t perform that action at this time.
0 commit comments