Restructured the folder structure of the executable target.

This commit is contained in:
2025-01-17 23:19:01 +01:00
parent 94e28a324b
commit 6955d816ef
4 changed files with 5 additions and 5 deletions
@@ -0,0 +1,37 @@
import ArgumentParser
import ColibriLibrary
extension Colibri {
struct Create: AsyncParsableCommand {
// MARK: Properties
static let configuration = CommandConfiguration(
commandName: "create-project",
abstract: "Create a new, tailored Hummingbird app",
helpNames: .shortAndLong,
aliases: ["create"]
)
@OptionGroup var options: Options
// MARK: Functions
mutating func run() async throws {
let fileService = FileService()
let copyFiles = CopyFilesTask(fileService: fileService)
let createFolders = CreateFoldersTask(fileService: fileService)
let createRootFolder = CreateRootFolderTask(fileService: fileService)
let rootFolder = try await createRootFolder(
name: options.name,
at: options.locationURL
)
try await createFolders(at: rootFolder)
try await copyFiles(to: rootFolder)
}
}
}