Skip to content

Commit bcd91a0

Browse files
committed
fix(modrinth): correct path-list mutation and rollback partial deletes
1 parent 7a11386 commit bcd91a0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎launcher-core/src/main/kotlin/pl/syntaxdevteam/syntaxlauncher/core/mods/LocalModManager.kt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,15 @@ class LocalModManager(private val instances: MinecraftInstanceRepository) {
254254
Files.copy(from, backup.resolve("old-$index.jar"))
255255
}
256256
backupStore.write(backup, receipt)
257-
oldPaths.forEach { Files.delete(it) }
258257
changed = true
258+
oldPaths.forEach { Files.delete(it) }
259259
incoming.forEachIndexed { index, triple ->
260260
val enabledName = newNames[index]
261261
val name = if (receipt.items[index].wasDisabled) "$enabledName.disabled" else enabledName
262262
val target = mods.resolve(name)
263263
check(!Files.exists(target, LinkOption.NOFOLLOW_LINKS))
264264
move(triple.first, target)
265-
published += target
265+
published.add(target)
266266
}
267267
val records = tracked.toMutableMap()
268268
receipt.items.forEach { item ->

0 commit comments

Comments
 (0)