factorio mod deploy tweaks (better confirmation and link to the page)
This commit is contained in:
parent
d2768c3c9e
commit
4cdbaa9daf
1 changed files with 2 additions and 16 deletions
|
|
@ -71,7 +71,7 @@ class FactorioModPortalPublishClient(
|
|||
"",
|
||||
)
|
||||
|
||||
val confirmed = enteredVersion.trim() == modVersion.trim()
|
||||
val confirmed = enteredVersion.trim().equals(modVersion.trim(), ignoreCase = true)
|
||||
|
||||
if (confirmed) {
|
||||
upload(initUploadResponse)
|
||||
|
|
@ -98,7 +98,7 @@ class FactorioModPortalPublishClient(
|
|||
require(response.status.isSuccess()) { "init upload request failed" }
|
||||
|
||||
return when (initUploadResponse) {
|
||||
is Failure -> error(initUploadResponse)
|
||||
is Failure -> error(initUploadResponse)
|
||||
is InitUploadResponse.Success -> initUploadResponse
|
||||
}
|
||||
}
|
||||
|
|
@ -130,18 +130,4 @@ class FactorioModPortalPublishClient(
|
|||
}
|
||||
println("Mod uploaded successfully! ${modPortalBaseURl.removeSuffix("/")}/$modName")
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
/**
|
||||
* @see org.jetbrains.kotlin.cli.common.toBooleanLenient
|
||||
*/
|
||||
private fun String?.toBooleanLenient(): Boolean? = when (this?.lowercase()?.trim()) {
|
||||
null -> false
|
||||
in listOf("yes", "true", "on", "y") -> true
|
||||
in listOf("", "no", "false", "off", "n") -> false
|
||||
else -> null
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue