File tree Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Expand file tree Collapse file tree 3 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -340,14 +340,15 @@ public final class Process: ObjectIdentifierProtocol {
340
340
}
341
341
342
342
// Look for executable.
343
- guard Process . findExecutable ( arguments [ 0 ] ) != nil else {
344
- throw Process . Error. missingExecutableProgram ( program: arguments [ 0 ] )
343
+ let executable = arguments [ 0 ]
344
+ guard let absolutePath = Process . findExecutable ( executable) else {
345
+ throw Process . Error. missingExecutableProgram ( program: executable)
345
346
}
346
347
347
348
#if os(Windows)
348
349
_process = Foundation . Process ( )
349
350
_process? . arguments = Array ( arguments. dropFirst ( ) ) // Avoid including the executable URL twice.
350
- _process? . executableURL = URL ( fileURLWithPath : arguments [ 0 ] )
351
+ _process? . executableURL = absolutePath . asURL
351
352
_process? . environment = environment
352
353
353
354
if outputRedirection. redirectsOutput {
Original file line number Diff line number Diff line change 11
11
import TSCLibc
12
12
import Foundation
13
13
14
+ #if os(Windows)
15
+ public let executableFileSuffix = " .exe "
16
+ #else
17
+ public let executableFileSuffix = " "
18
+ #endif
19
+
14
20
/// Replace the current process image with a new process image.
15
21
///
16
22
/// - Parameters:
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public class Git {
57
57
}
58
58
59
59
/// A shell command to run for Git. Can be either a name or a path.
60
- public static var tool : String = " git "
60
+ public static var tool : String = " git \( executableFileSuffix ) "
61
61
62
62
/// Returns true if the git reference name is well formed.
63
63
public static func checkRefFormat( ref: String ) -> Bool {
You can’t perform that action at this time.
0 commit comments