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 73
73
if case . subcommand( let subcommand) = mode {
74
74
// We are running as a subcommand, try to find the subcommand adjacent to the executable we are running as.
75
75
// If we didn't find the tool there, let the OS search for it.
76
- let subcommandPath = Process . findExecutable ( arguments [ 0 ] ) ? . parentDirectory. appending ( component: subcommand)
76
+ let subcommandPath = Process . findExecutable ( CommandLine . arguments [ 0 ] ) ? . parentDirectory. appending ( component: subcommand)
77
77
?? Process . findExecutable ( subcommand)
78
78
79
- if subcommandPath == nil || !localFileSystem. exists ( subcommandPath!) {
79
+ guard let subcommandPath = subcommandPath,
80
+ localFileSystem. exists ( subcommandPath) else {
80
81
throw Driver . Error. unknownOrMissingSubcommand ( subcommand)
81
82
}
82
83
84
+ // Pass the full path to subcommand executable.
85
+ var arguments = arguments
86
+ arguments [ 0 ] = subcommandPath. pathString
87
+
83
88
// Execute the subcommand.
84
- try exec ( path: subcommandPath? . pathString ?? " " , args: arguments)
89
+ try exec ( path: subcommandPath. pathString, args: arguments)
85
90
}
86
91
87
92
let executor = try SwiftDriverExecutor ( diagnosticsEngine: diagnosticsEngine,
You can’t perform that action at this time.
0 commit comments