fix: multiple compatible pkgs on readme

This commit is contained in:
Sculas 2022-09-08 22:03:30 +02:00
parent 835a3b82c2
commit 88c1450fa4

View File

@ -17,13 +17,11 @@ fun generateText(bundle: Bundle) {
val output = StringBuilder()
val packages = mutableMapOf<String, MutableList<Class<out Patch<Data>>>>()
bundle.map {
val packageName = it.compatiblePackages?.first()?.name!!
if (!packages.contains(packageName)) {
packages[packageName] = mutableListOf()
for (patch in bundle) {
patch.compatiblePackages?.forEach { pkg ->
if (!packages.contains(pkg.name)) packages[pkg.name] = mutableListOf()
packages[pkg.name]!!.add(patch)
}
packages[packageName]?.add(it)
}
for (pkg in packages) {