CommandResult

public protocol CommandResult

Represents a running or finished command

  • The command that launched this result

    Declaration

    Swift

    var command: Command { get }
  • Returns true if the command is still running

    Declaration

    Swift

    var isRunning: Bool { get }
  • exitCode() Default implementation

    Block until command is finished, and return exit code

    Default Implementation

    return exit code asynchronously

    Declaration

    Swift

    func exitCode() -> Int32
  • succeed() Default implementation

    Block and throw an error if exitCode is non-zero

    Default Implementation

    throw an error if exitCode is non-zero asynchronously

    Declaration

    Swift

    func succeed() throws
  • Sends a signal to a process,

    Declaration

    Swift

    func kill(signal: Int32) throws
  • withSyncContext(f:) Extension method

    Undocumented

    Declaration

    Swift

    func withSyncContext<R>(f: () throws -> R) rethrows -> R
  • finish() Extension method

    Wait for the command to finish, ignoring any exit code

    Declaration

    Swift

    @available(macOS 10.15, *)
    @discardableResult
    public func finish() async -> Self
  • finish() Extension method

    Wait for the command to finish, ignoring any exit code

    Declaration

    Swift

    @discardableResult
    public func finish() -> Self
  • defaultSucceed(name:) Extension method

    A default implementation that can be used for succeed

    Declaration

    Swift

    public func defaultSucceed(name: String = "\(Self.self)") throws
  • kill() Extension method

    Sends a TERM signal to a process,

    Declaration

    Swift

    public func kill() throws