@@ -5,14 +5,14 @@ public protocol TerminalType {
55 func streamCommand(
66 _ command: String ,
77 arguments: [ String ] ,
8- currentDirectoryPath : String ,
8+ currentDirectoryURL : URL ? ,
99 environment: [ String : String ]
1010 ) -> AsyncThrowingStream < String , Error >
1111
1212 func runCommand(
1313 _ command: String ,
1414 arguments: [ String ] ,
15- currentDirectoryPath : String ,
15+ currentDirectoryURL : URL ? ,
1616 environment: [ String : String ]
1717 ) async throws -> String
1818
@@ -44,15 +44,15 @@ public final class Terminal: TerminalType, @unchecked Sendable {
4444 public func streamCommand(
4545 _ command: String = " /bin/bash " ,
4646 arguments: [ String ] ,
47- currentDirectoryPath : String = " / " ,
47+ currentDirectoryURL : URL ? = nil ,
4848 environment: [ String : String ]
4949 ) -> AsyncThrowingStream < String , Error > {
5050 self . process? . terminate ( )
5151 let process = Process ( )
5252 self . process = process
5353
5454 process. launchPath = command
55- process. currentDirectoryPath = currentDirectoryPath
55+ process. currentDirectoryURL = currentDirectoryURL
5656 process. arguments = arguments
5757 process. environment = getEnvironmentVariables ( )
5858 . merging ( environment, uniquingKeysWith: { $1 } )
@@ -128,12 +128,12 @@ public final class Terminal: TerminalType, @unchecked Sendable {
128128 public func runCommand(
129129 _ command: String = " /bin/bash " ,
130130 arguments: [ String ] ,
131- currentDirectoryPath : String = " / " ,
131+ currentDirectoryURL : URL ? = nil ,
132132 environment: [ String : String ]
133133 ) async throws -> String {
134134 let process = Process ( )
135135 process. launchPath = command
136- process. currentDirectoryPath = currentDirectoryPath
136+ process. currentDirectoryURL = currentDirectoryURL
137137 process. arguments = arguments
138138 process. environment = getEnvironmentVariables ( )
139139 . merging ( environment, uniquingKeysWith: { $1 } )
0 commit comments