RunOutput

public final class RunOutput

Output from a run command.

  • The error from running the command, if any.

    Declaration

    Swift

    public let error: CommandError?
  • Standard output, trimmed of whitespace and newline if it is single-line.

    Declaration

    Swift

    public private(set) lazy var stdout: String { get set }
  • Standard error, trimmed of whitespace and newline if it is single-line.

    Declaration

    Swift

    public private(set) lazy var stderror: String { get set }
  • The exit code of the command. Anything but 0 means there was an error.

    Declaration

    Swift

    public var exitcode: Int { get }
  • Checks if the exit code is 0.

    Declaration

    Swift

    public var succeeded: Bool { get }
  • Runs the first command, then the second one only if the first succeeded.

    Declaration

    Swift

    @discardableResult
    public static func && (lhs: RunOutput, rhs: @autoclosure () -> RunOutput) -> RunOutput

    Return Value

    the result of the second one if it was run, otherwise the first one.

  • Runs the first command, then the second one only if the first failed.

    Declaration

    Swift

    @discardableResult
    public static func || (lhs: RunOutput, rhs: @autoclosure () -> RunOutput) -> RunOutput

    Return Value

    the result of the second one if it was run, otherwise the first one.