From d722bfa0deb44205cd749d61c06f7abe8aa41081 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 6 Mar 2024 09:39:11 +0100 Subject: added title --- src/main/kotlin/Main.kt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt index 7ecd07f..129dd40 100644 --- a/src/main/kotlin/Main.kt +++ b/src/main/kotlin/Main.kt @@ -31,26 +31,27 @@ fun getTextFromUrl(urlString: String): List { } fun main() { - val firstPr = 1071 + val firstPr = 1106 val hideWhenError = true + val title = "Version 0.24 Beta 5" - println(" ") + println("") val url = "https://api.github.com/repos/hannibal002/SkyHanni/pulls?state=closed&sort=updated&direction=desc&per_page=50" val data = getTextFromUrl(url).joinToString("") val gson = GsonBuilder().create() val fromJson = gson.fromJson(data, JsonArray::class.java) val prs = fromJson.map { gson.fromJson(it, PullRequest::class.java) } - readPrs(prs, firstPr, hideWhenError) + readPrs(prs, firstPr, hideWhenError, title) } -fun readPrs(prs: List, firstPr: Int, hideWhenError: Boolean) { +fun readPrs(prs: List, firstPr: Int, hideWhenError: Boolean, title: String) { val categories = mutableListOf() val allChanges = mutableListOf() findAllChanges(prs, allChanges, categories, firstPr, hideWhenError) for (type in OutputType.entries) { - print(categories, allChanges, type) + print(categories, allChanges, type, title) } } @@ -64,16 +65,18 @@ private fun print( categories: MutableList, allChanges: MutableList, outputType: OutputType, + title: String, ) { val extraInfoPrefix = when (outputType) { OutputType.DISCORD_PUBLIC -> " = " OutputType.GITHUB -> " * " OutputType.DISCORD_INTERNAL -> " " } - println(" ") - println(" ") + println("") + println("") println("outputType: $outputType") - println(" ") + println("") + println("## $title") for (category in allowedCategories.map { getCategory(categories, it) }) { if (outputType == OutputType.DISCORD_PUBLIC && category.name == "Technical Details") continue val changes = allChanges.filter { it.category == category } -- cgit