Fix detecting addons from zip file

Also set the default to `collectOutput` where it would parse the
output of an addon.
This commit is contained in:
eikek
2022-05-27 22:44:05 +02:00
parent e56e313cb9
commit 4ce64d2841
6 changed files with 55 additions and 4 deletions

View File

@ -34,7 +34,7 @@ case class AddonMeta(
s"${meta.name}-${meta.version}"
def parseResult: Boolean =
options.exists(_.collectOutput)
options.forall(_.collectOutput)
def ignoreResult: Boolean =
!parseResult
@ -200,7 +200,7 @@ object AddonMeta {
)
)
zipFile
.through(Zip.unzip(8192, Glob("**/docspell-addon.*")))
.through(Zip.unzip(8192, Glob("docspell-addon.*|**/docspell-addon.*")))
.filter(bin => !bin.name.endsWith("/"))
.flatMap { bin =>
if (bin.extensionIn(Set("json"))) Stream.eval(AddonMeta.fromJsonBytes(bin.data))