diff options
author | nea <nea@nea.moe> | 2023-10-14 22:58:40 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-10-14 22:58:40 +0200 |
commit | bc758d17e2ac5c507117f85bf76b081a05f2baca (patch) | |
tree | 6722dadec2ecaab9b6656468d9ea37462f8efd2a /src/main/kotlin/moe | |
parent | 08b69dde127752bc9d22cfd756a9a4aaf5449915 (diff) | |
download | firmament-bc758d17e2ac5c507117f85bf76b081a05f2baca.tar.gz firmament-bc758d17e2ac5c507117f85bf76b081a05f2baca.tar.bz2 firmament-bc758d17e2ac5c507117f85bf76b081a05f2baca.zip |
Fix hitting file limit when downloading repo
Diffstat (limited to 'src/main/kotlin/moe')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/repo/RepoDownloadManager.kt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/repo/RepoDownloadManager.kt b/src/main/kotlin/moe/nea/firmament/repo/RepoDownloadManager.kt index 18f8e49..ffb4b6e 100644 --- a/src/main/kotlin/moe/nea/firmament/repo/RepoDownloadManager.kt +++ b/src/main/kotlin/moe/nea/firmament/repo/RepoDownloadManager.kt @@ -110,12 +110,13 @@ object RepoDownloadManager { entry.name.substringAfter('/', missingDelimiterValue = "") ) 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.") - throw RuntimeException("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("Firmament detected an invalid zip file. This is a potential security risk, please report this in the Firmament discord.") } extractedLocation.parent.createDirectories() - cis.copyTo(extractedLocation.outputStream()) - cis.closeEntry() + cis.use { + extractedLocation.outputStream().use { cis.copyTo(it) } + } } } } |