This PR contains the work done to add the *Build* subcommand that build a *Hummingbird* project from the command line to the `Colibri` command. Reviewed-on: #5 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
30 lines
729 B
Swift
30 lines
729 B
Swift
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)
|
|
}
|
|
|
|
}
|
|
}
|