Implemented the UpdateCommand command in the executable target.

This commit is contained in:
Javier Cicchelli 2025-02-19 01:09:12 +01:00
parent 26a5e4232a
commit 97467f2ed8
2 changed files with 42 additions and 0 deletions

View File

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

View File

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