Implemented the BuildCommand command in the executable target.
This commit is contained in:
parent
4425a1ce73
commit
4cf3eb6784
29
Executable/Sources/Commands/BuildCommand.swift
Normal file
29
Executable/Sources/Commands/BuildCommand.swift
Normal 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)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
13
Executable/Sources/Options/BuildOptions.swift
Normal file
13
Executable/Sources/Options/BuildOptions.swift
Normal file
@ -0,0 +1,13 @@
|
||||
import ArgumentParser
|
||||
import ColibriLibrary
|
||||
|
||||
extension Colibri.Build {
|
||||
struct Options: ParsableArguments, Locationable {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
@Option(name: .shortAndLong)
|
||||
var location: String?
|
||||
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user