This PR contains the work done to create the root folder of a new project when executing the _colibri_ executable. In addition, some other work has been done: * added the `ArgumentParser` package dependency to the package; * implemented the `FileService` service in the _library_ target; * implemented the `CreateRootFolderTask` task in the _library_ target; * removed some unnecessary comments and boilerplate code; Reviewed-on: #2 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
26 lines
552 B
Swift
26 lines
552 B
Swift
import Foundation
|
|
|
|
public protocol FileServicing {
|
|
|
|
// MARK: Computed
|
|
|
|
var currentFolder: URL { get async }
|
|
|
|
// MARK: Functions
|
|
|
|
func createFolder(at url: URL) async throws (FileServiceError)
|
|
func delete(at url: URL) async throws (FileServiceError)
|
|
func exists(at url: URL) async throws (FileServiceError) -> Bool
|
|
|
|
}
|
|
|
|
// MARK: - Errors
|
|
|
|
public enum FileServiceError: Error, Equatable {
|
|
case folderNotCreated
|
|
case urlAlreadyExists
|
|
case urlNotDeleted
|
|
case urlNotExists
|
|
case urlNotFileURL
|
|
}
|