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 7373 if case . subcommand( let subcommand) = mode {
7474 // We are running as a subcommand, try to find the subcommand adjacent to the executable we are running as.
7575 // 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)
7777 ?? Process . findExecutable ( subcommand)
7878
79- if subcommandPath == nil || !localFileSystem. exists ( subcommandPath!) {
79+ guard let subcommandPath = subcommandPath,
80+ localFileSystem. exists ( subcommandPath) else {
8081 throw Driver . Error. unknownOrMissingSubcommand ( subcommand)
8182 }
8283
84+ // Pass the full path to subcommand executable.
85+ var arguments = arguments
86+ arguments [ 0 ] = subcommandPath. pathString
87+
8388 // Execute the subcommand.
84- try exec ( path: subcommandPath? . pathString ?? " " , args: arguments)
89+ try exec ( path: subcommandPath. pathString, args: arguments)
8590 }
8691
8792 let executor = try SwiftDriverExecutor ( diagnosticsEngine: diagnosticsEngine,
You can’t perform that action at this time.
0 commit comments