Implemented the Update subcommand (#7)
This PR contains the work done to implement the `Update` subcommand that update the package dependencies in a *Hummingbird* project. Reviewed-on: #7 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #7.
This commit is contained in:
@@ -20,9 +20,9 @@ extension Colibri {
|
||||
mutating func run() async throws {
|
||||
let terminalService = TerminalService()
|
||||
|
||||
let outdatedDependencies = OutdatedDependenciesTask(terminalService: terminalService)
|
||||
let updateDependencies = UpdateDependenciesTask(terminalService: terminalService)
|
||||
|
||||
try await outdatedDependencies(at: options.locationURL)
|
||||
try await updateDependencies(at: options.locationURL, checkOutdated: true)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user