Implemented the CreateFoldersTask task in the library target.
This commit is contained in:
@@ -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 {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user