4
0
Fork 0
mirror of https://github.com/Anvilcraft/modpacktools synced 2025-03-14 12:09:59 +01:00

fix really stupid mistake when downloading mods in BuildTwitch

This commit is contained in:
LordMZTE 2020-07-29 14:14:37 +02:00
parent 4cfc122dea
commit a212e03e59

View file

@ -53,15 +53,16 @@ object BuildTwitch : ICommand {
} else if(uf.key.isURL) {
val filePath = URL(uf.key.link)
toDownload[filePath] = Pair(File(downloadDir, FilenameUtils.getName(filePath.toString())), uf.value)
FileDownloader(toDownload.mapValues {it.value.first}, {
println("downloaded file ${it.file}")
println(installFile(toDownload[it.url]!!.second, it.file))
}, FileDownloader.ExistingFileBehaviour.OVERWRITE)
} else {
return fail("{$uf.key.link} is neither a file nor an URL")
}
}
FileDownloader(toDownload.mapValues {it.value.first}, {
println("downloaded file ${it.file}")
println(installFile(toDownload[it.url]!!.second, it.file))
}, FileDownloader.ExistingFileBehaviour.OVERWRITE)
val zip = ZipOutputStream(FileOutputStream(dir.path + "/$archiveName.zip"))
tmp.toZip(zip)
zip.flush()