Skip to content

Commit

Permalink
do not blindly delete files
Browse files Browse the repository at this point in the history
  • Loading branch information
NikkyAI committed Feb 28, 2021
1 parent 748e622 commit 940a20f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions multimc/installer/src/main/kotlin/voodoo/multimc/Installer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ object Installer : KLogging() {
private suspend fun selfupdate(instanceDir: File, installerUrl: String, phase: Phase): File? {
logger.info { "installer url from modpack: $installerUrl" }
val voodooFolder = instanceDir.resolve(".voodoo").apply { mkdirs() }
voodooFolder.listFiles().forEach {
it.delete()
}
// TODO: cleanup old files smarter
// voodooFolder.listFiles().forEach {
// it.delete()
// }
val toDeleteFile = voodooFolder.resolve("to-delete.txt")
toDeleteFile.parentFile.mkdirs()
val currentJarFile = File(Installer::class.java.protectionDomain.codeSource.location.toURI())
Expand Down

0 comments on commit 940a20f

Please sign in to comment.