Read from repository configs instead of hardcoding repos/arch for update

This commit is contained in:
2024-11-16 00:30:19 +11:00
parent 1b6883c9df
commit e8d101edb5
4 changed files with 56 additions and 46 deletions

View File

@ -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()
}
}