diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-03-06 09:39:11 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-03-06 09:39:11 +0100 |
commit | d722bfa0deb44205cd749d61c06f7abe8aa41081 (patch) | |
tree | 187ce592ec82482b6d0d64ba7febe6a168d02d19 | |
parent | 7b0ea53376bca05aadc9cfcecce1080784c43de7 (diff) | |
download | SkyHanniChangelogBuilder-d722bfa0deb44205cd749d61c06f7abe8aa41081.tar.gz SkyHanniChangelogBuilder-d722bfa0deb44205cd749d61c06f7abe8aa41081.tar.bz2 SkyHanniChangelogBuilder-d722bfa0deb44205cd749d61c06f7abe8aa41081.zip |
added title
-rw-r--r-- | src/main/kotlin/Main.kt | 19 |
1 files 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<String> { } 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<PullRequest>, firstPr: Int, hideWhenError: Boolean) { +fun readPrs(prs: List<PullRequest>, firstPr: Int, hideWhenError: Boolean, title: String) { val categories = mutableListOf<Category>() val allChanges = mutableListOf<Change>() 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<Category>, allChanges: MutableList<Change>, 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 } |