mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-10-16 16:04:32 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a8f8444d45 | ||
|
d98baaf832 |
@@ -101,7 +101,7 @@ class Main(args: Array<String>) {
|
||||
cmd.getOptionValue("multimc-folder")?.let{ PackwizFilePath(it.toPath()) } ?: PackwizFilePath("..".toPath())
|
||||
}
|
||||
val manifestFile = ui.wrap("Invalid manifest file path") {
|
||||
packFolder / (cmd.getOptionValue("meta-file") ?: "manifest.json")
|
||||
packFolder / (cmd.getOptionValue("meta-file") ?: "packwiz.json")
|
||||
}
|
||||
|
||||
// Start update process!
|
||||
|
@@ -21,7 +21,14 @@ data class Hash<T>(val type: HashFormat<T>, val value: T) {
|
||||
|
||||
object UInt: Encoding<kotlin.UInt> {
|
||||
override fun encodeToString(value: kotlin.UInt) = value.toString()
|
||||
override fun decodeFromString(str: String) = str.toUInt()
|
||||
override fun decodeFromString(str: String) =
|
||||
try {
|
||||
str.toUInt()
|
||||
} catch (e: NumberFormatException) {
|
||||
// Old packwiz.json values are signed; if they are negative they should be parsed as signed integers
|
||||
// and reinterpreted as unsigned integers
|
||||
str.toInt().toUInt()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user