Implemented the CreateFoldersTask task in the library target.

This commit is contained in:
2025-01-13 00:33:13 +01:00
parent 2852f4b1bf
commit d065425c69
5 changed files with 89 additions and 19 deletions
@@ -0,0 +1,38 @@
import Foundation
public struct CreateFoldersTask {
// MARK: Properties
private let fileService: FileServicing
// MARK: Initialisers
public init(fileService: FileServicing) {
self.fileService = fileService
}
// MARK: Functions
public func callAsFunction(at rootFolder: URL) async throws {
let folderApp = rootFolder.appendingPath(.folderApp)
let folderAppInfrastructure = rootFolder.appendingPath(.folderAppInfrastructure)
let folderAppTestCases = rootFolder.appendingPath(.folderAppTestCases)
let folderAppTestSources = rootFolder.appendingPath(.folderAppTestSources)
try await fileService.createFolder(at: folderApp)
try await fileService.createFolder(at: folderAppInfrastructure)
try await fileService.createFolder(at: folderAppTestCases)
try await fileService.createFolder(at: folderAppTestSources)
}
}
// MARK: - String+Constants
private extension String {
static let folderApp = "Sources/App"
static let folderAppInfrastructure = "Sources/AppInfrastructure"
static let folderAppTestCases = "Tests/App/Cases"
static let folderAppTestSources = "Tests/App/Sources"
}
@@ -1,3 +0,0 @@
public struct CreateProjectTask {
}