Improved the implementation for the CreateFolderTask task in the library target.
This commit is contained in:
@@ -15,7 +15,7 @@ public struct CreateFoldersTask {
|
||||
// MARK: Functions
|
||||
|
||||
public func callAsFunction(at rootFolder: URL) async throws {
|
||||
let folders = Self.foldersToCreate.map { rootFolder.appendingPath($0) }
|
||||
let folders = Folder.allCases.map { rootFolder.appendingPath($0.rawValue) }
|
||||
|
||||
for folder in folders {
|
||||
try await fileService.createFolder(at: folder)
|
||||
@@ -23,18 +23,3 @@ public struct CreateFoldersTask {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
extension CreateFoldersTask {
|
||||
|
||||
// MARK: Constants
|
||||
|
||||
static let foldersToCreate: [String] = [
|
||||
"Sources/App",
|
||||
"Sources/AppInfrastructure",
|
||||
"Tests/App/Cases",
|
||||
"Tests/App/Sources"
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user