Implemented the Template enumeration in the library target.
This commit is contained in:
parent
87dc069917
commit
91762b18cd
37
Library/Sources/Internal/Enumerations/Template.swift
Normal file
37
Library/Sources/Internal/Enumerations/Template.swift
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
enum Template: String {
|
||||||
|
case app = "App"
|
||||||
|
case appTests = "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 {}
|
Loading…
x
Reference in New Issue
Block a user