Files
darwin-apk/Sources/dpk-cli/Subcommands/DpkUpdateCommand.swift

24 lines
618 B
Swift

/*
* darwin-apk © 2024 Gay Pizza Specifications
* SPDX-License-Identifier: Apache-2.0
*/
import Foundation
import ArgumentParser
import darwin_apk
struct DpkUpdateCommand: AsyncParsableCommand {
static let configuration = CommandConfiguration(
commandName: "update",
abstract: "Update the system package repositories.",
aliases: [ "u" ])
func run() async throws {
print("Updating package repositories")
let repositories = try await RepositoriesConfig().repositories
var updater = ApkIndexUpdater()
updater.repositories.append(contentsOf: repositories)
updater.update()
}
}