first async refactor of fetch/index

This commit is contained in:
2024-11-17 02:31:44 +11:00
parent badc6dd39e
commit 8c7f0f23d5
13 changed files with 112 additions and 32 deletions

View File

@ -41,10 +41,10 @@ struct DpkSearchCommand: AsyncParsableCommand {
let match: any PatternMatcher
match = try matcher.init(patterns: patterns, ignoreCase: !self.caseSensitive)
let localRepositories = try await RepositoriesConfig().localRepositories
let localRepositories = try await ApkRepositoriesConfig()
let index: ApkIndex
do {
index = ApkIndex.merge(try localRepositories.map(ApkIndex.init))
index = try await ApkIndex.resolve(localRepositories, fetch: .local)
} catch {
print("Failed to build package index: \(error.localizedDescription)")
throw .failure