Skip to content

Commit 22d6015

Browse files
committed
TSCBasic: honour workingDirectory on Windows' Process management
If `workingdirectory` is set, ensure that it is honoured when creating the process. This repairs a previous test failure in SPM.
1 parent 33ae5ab commit 22d6015

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/TSCBasic/Process.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,9 @@ public final class Process {
529529
let process = Foundation.Process()
530530
_process = process
531531
process.arguments = Array(arguments.dropFirst()) // Avoid including the executable URL twice.
532+
if let workingDirectory {
533+
process.currentDirectoryURL = workingDirectory.asURL
534+
}
532535
process.executableURL = executablePath.asURL
533536
process.environment = environment
534537

0 commit comments

Comments
 (0)