         return String(data: data, encoding: .utf8) ?? ""
     }
 
-    public var exitCode: Int? {
-        Int(process.terminationStatus)
+    public var exitCode: Int32 {
+        process.terminationStatus
     }
 
     public var succeeded: Bool {
-        exitCode == 0
+        process.terminationReason == .exit && exitCode == 0
     }
 
     public var failed: Bool {

    var stdoutPipe: Pipe { get }
    var stderrPipe: Pipe { get }

    var exitCode: Int? { get }
    var succeeded: Bool { get }
    var failed: Bool { get }


        process.standardError = stderrPipe
        process.arguments = arguments

        if #available(macOS 10.13, *) {
            process.executableURL = URL(fileURLWithPath: binaryPath)
            try process.run()
        } else {
            process.launchPath = binaryPath
            process.launch()
