Implemented the BuildCommand command in the executable target.

This commit is contained in:
Javier Cicchelli 2025-02-18 23:53:08 +01:00
parent 4425a1ce73
commit 4cf3eb6784
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,29 @@
import ArgumentParser
import ColibriLibrary
extension Colibri {
struct Build: AsyncParsableCommand {
// MARK: Properties
static let configuration = CommandConfiguration(
commandName: "build-project",
abstract: "Build a Hummingbird app",
helpNames: .shortAndLong,
aliases: ["build"]
)
@OptionGroup var options: Options
// MARK: Functions
mutating func run() async throws {
let terminalService = TerminalService()
let buildProject = BuildProjectTask(terminalService: terminalService)
try await buildProject(at: options.locationURL)
}
}
}

View File

@ -0,0 +1,13 @@
import ArgumentParser
import ColibriLibrary
extension Colibri.Build {
struct Options: ParsableArguments, Locationable {
// MARK: Properties
@Option(name: .shortAndLong)
var location: String?
}
}