2025-01-12 01:42:43 +01:00
|
|
|
import ArgumentParser
|
|
|
|
import ColibriLibrary
|
|
|
|
|
|
|
|
extension Colibri {
|
|
|
|
struct Create: AsyncParsableCommand {
|
|
|
|
|
|
|
|
// MARK: Properties
|
|
|
|
|
|
|
|
static let configuration = CommandConfiguration(
|
2025-01-12 02:41:17 +01:00
|
|
|
commandName: "create-project",
|
|
|
|
abstract: "Create a new, tailored Hummingbird app",
|
2025-01-12 01:42:43 +01:00
|
|
|
helpNames: .shortAndLong,
|
|
|
|
aliases: ["create"]
|
|
|
|
)
|
|
|
|
|
|
|
|
@OptionGroup var options: Options
|
2025-01-12 02:41:17 +01:00
|
|
|
|
2025-01-12 01:42:43 +01:00
|
|
|
// MARK: Functions
|
|
|
|
|
|
|
|
mutating func run() async throws {
|
2025-01-12 02:41:17 +01:00
|
|
|
let fileService = FileService()
|
|
|
|
let createRootFolder = CreateRootFolderTask(fileService: fileService)
|
|
|
|
|
|
|
|
let rootFolder = try await createRootFolder(
|
|
|
|
name: options.name,
|
|
|
|
at: options.locationURL
|
|
|
|
)
|
|
|
|
|
|
|
|
print(rootFolder)
|
2025-01-12 01:42:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|