Skip to content

Commit e0de0af

Browse files
committed
Fix looking up for self (the driver executable)
The `arguments` is modified by `Driver.invocationRunMode`, so the first element is no longer the driver itself.
1 parent 2ec15a1 commit e0de0af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/swift-driver/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ do {
6363
if case .subcommand(let subcommand) = mode {
6464
// We are running as a subcommand, try to find the subcommand adjacent to the executable we are running as.
6565
// If we didn't find the tool there, let the OS search for it.
66-
let subcommandPath = Process.findExecutable(arguments[0])?.parentDirectory.appending(component: subcommand)
66+
let subcommandPath = Process.findExecutable(CommandLine.arguments[0])?.parentDirectory.appending(component: subcommand)
6767
?? Process.findExecutable(subcommand)
6868

6969
if subcommandPath == nil || !localFileSystem.exists(subcommandPath!) {

0 commit comments

Comments
 (0)