Improved the implementation for the CreateFolderTask task in the library target.

This commit is contained in:
2025-01-18 04:25:01 +01:00
parent 9ee7592902
commit 026251ad6d
3 changed files with 34 additions and 25 deletions
@@ -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"
]
}