aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/moe/nea/firmament/repo/RepoDownloadManager.kt9
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) }
+ }
}
}
}