Fix hitting file limit when downloading repo

This commit is contained in:
nea
2023-10-14 22:58:40 +02:00
parent 08b69dde12
commit bc758d17e2

View File

@@ -110,12 +110,13 @@ object RepoDownloadManager {
entry.name.substringAfter('/', missingDelimiterValue = "") entry.name.substringAfter('/', missingDelimiterValue = "")
) )
if (repoSavedLocation !in extractedLocation.iterate { it.parent }) { if (repoSavedLocation !in extractedLocation.iterate { it.parent }) {
logger.error("Not Enough Updates detected an invalid zip file. This is a potential security risk, please report this in the Moulberry discord.") logger.error("Firmament detected an invalid zip file. This is a potential security risk, please report this in the Firmament discord.")
throw RuntimeException("Not Enough Updates detected an invalid zip file. This is a potential security risk, please report this in the Moulberry discord.") throw RuntimeException("Firmament detected an invalid zip file. This is a potential security risk, please report this in the Firmament discord.")
} }
extractedLocation.parent.createDirectories() extractedLocation.parent.createDirectories()
cis.copyTo(extractedLocation.outputStream()) cis.use {
cis.closeEntry() extractedLocation.outputStream().use { cis.copyTo(it) }
}
} }
} }
} }