From 245529f88f6657c3ee991579cfbe6a813024ceb6 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sat, 18 Jan 2025 20:04:24 +0100 Subject: [PATCH] Implemented the Processable protocol in the library target and conformed the Process object to it. --- .../Extensions/Process+Conformances.swift | 5 +++++ .../Internal/Protocols/Processable.swift | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Library/Sources/Internal/Extensions/Process+Conformances.swift create mode 100644 Library/Sources/Internal/Protocols/Processable.swift diff --git a/Library/Sources/Internal/Extensions/Process+Conformances.swift b/Library/Sources/Internal/Extensions/Process+Conformances.swift new file mode 100644 index 0000000..d5dfa7b --- /dev/null +++ b/Library/Sources/Internal/Extensions/Process+Conformances.swift @@ -0,0 +1,5 @@ +import Foundation + +// MARK: - Processable + +extension Process: Processable {} diff --git a/Library/Sources/Internal/Protocols/Processable.swift b/Library/Sources/Internal/Protocols/Processable.swift new file mode 100644 index 0000000..42cb1b9 --- /dev/null +++ b/Library/Sources/Internal/Protocols/Processable.swift @@ -0,0 +1,17 @@ +import Foundation + +protocol Processable { + + // MARK: Properties + + var arguments: [String]? { get set } + var executableURL: URL? { get set } + var standardError: Any? { get set } + var standardOutput: Any? { get set } + var terminationHandler: (@Sendable (Process) -> Void)? { get set } + + // MARK: Functions + + func run() throws + +}