mirror of
https://github.com/GayPizzaSpecifications/darwin-apk.git
synced 2025-08-04 05:51:31 +00:00
Read from repository configs instead of hardcoding repos/arch for update
This commit is contained in:
@ -7,15 +7,17 @@ import Foundation
|
||||
import ArgumentParser
|
||||
import darwin_apk
|
||||
|
||||
struct DpkUpdateCommand: ParsableCommand {
|
||||
struct DpkUpdateCommand: AsyncParsableCommand {
|
||||
static let configuration = CommandConfiguration(
|
||||
commandName: "update",
|
||||
abstract: "Update the system package repositories.",
|
||||
aliases: [ "u" ])
|
||||
|
||||
func run() throws {
|
||||
func run() async throws {
|
||||
print("Updating package repositories")
|
||||
let repositories = try await RepositoriesConfig().repositories
|
||||
var updater = ApkIndexUpdater()
|
||||
updater.repositories.append(contentsOf: repositories)
|
||||
updater.update()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user