Fix of minor versions

This commit is contained in:
Elena Lepilkina
2019-05-17 16:30:16 +03:00
parent 36faec53e4
commit 6c7075cba4
@@ -224,7 +224,7 @@ fun main(args: Array<String>) {
error("Response is expected to be an array.")
}
val builds = data.jsonArray.map { Build.create(it as JsonObject) }
.sortedWith(compareBy ( { it.buildNumber.substringBefore("-").toDouble() }, { it.buildNumber.substringAfterLast("-").toInt() }))
.sortedWith(compareBy ( { it.buildNumber.substringBefore(".").toInt() }, { it.buildNumber.substringAfter(".").substringBefore("-").toDouble() }, { it.buildNumber.substringAfterLast("-").toInt() }))
val branchesUrl = "$serverUrl/branches/${parameters["target"]}"