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>
38 lines
663 B
Swift
38 lines
663 B
Swift
enum Template: String {
|
|
case app = "App/App"
|
|
case appTests = "Test/AppTests"
|
|
case package = "Package"
|
|
}
|
|
|
|
// MARK: - Properties
|
|
|
|
extension Template {
|
|
|
|
// MARK: Computed
|
|
|
|
var fileName: String {
|
|
switch self {
|
|
case .app: "App.swift"
|
|
case .appTests: "AppTests.swift"
|
|
case .package: "Package.swift"
|
|
}
|
|
}
|
|
|
|
var filePath: String {
|
|
folder.path + fileName
|
|
}
|
|
|
|
var folder: Folder {
|
|
switch self {
|
|
case .app: .app
|
|
case .appTests: .testCasesPublic
|
|
default: .root
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
// MARK: - CaseIterable
|
|
|
|
extension Template: CaseIterable {}
|