mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-10-16 16:04:32 +02:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
858fd17f3e |
@@ -180,17 +180,19 @@ internal class DownloadTask private constructor(val metadata: IndexFile.File, de
|
||||
fun download(packFolder: String, indexUri: SpaceSafeURI) {
|
||||
if (err != null) return
|
||||
|
||||
// Ensure wrong-side or optional false files are removed
|
||||
// Exclude wrong-side and optional false files
|
||||
cachedFile?.let {
|
||||
if ((it.isOptional && !it.optionValue) || !correctSide()) {
|
||||
if (it.cachedLocation != null) {
|
||||
// Ensure wrong-side or optional false files are removed
|
||||
try {
|
||||
Files.deleteIfExists(Paths.get(packFolder, it.cachedLocation))
|
||||
} catch (e: IOException) {
|
||||
Log.warn("Failed to delete file before downloading", e)
|
||||
Log.warn("Failed to delete file", e)
|
||||
}
|
||||
}
|
||||
it.cachedLocation = null
|
||||
return
|
||||
}
|
||||
}
|
||||
if (alreadyUpToDate) return
|
||||
|
Reference in New Issue
Block a user