This PR contains the work done to support input parameters for the `create` command of the executable target, and to render content dynamically for the newly-generated project. Reviewed-on: #4 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
40 lines
738 B
Swift
40 lines
738 B
Swift
import ColibriLibrary
|
|
import Foundation
|
|
|
|
final class TerminalServiceSpy {
|
|
|
|
// MARK: Properties
|
|
|
|
private(set) var actions: [Action] = []
|
|
|
|
}
|
|
|
|
// MARK: - TerminalServicing
|
|
|
|
extension TerminalServiceSpy: TerminalServicing {
|
|
|
|
// MARK: Functions
|
|
|
|
@discardableResult
|
|
func run(_ executableURL: URL, arguments: [String]) async throws(TerminalServiceError) -> String {
|
|
actions.append(.ran(executableURL, arguments))
|
|
|
|
return .content
|
|
}
|
|
|
|
}
|
|
|
|
// MARK: - Actions
|
|
|
|
extension TerminalServiceSpy {
|
|
enum Action: Equatable {
|
|
case ran(_ executableURL: URL, _ arguments: [String])
|
|
}
|
|
}
|
|
|
|
// MARK: - String+Constants
|
|
|
|
private extension String {
|
|
static let content = ""
|
|
}
|