diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-03-13 21:01:26 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-03-13 21:01:26 +0100 |
commit | 4161d7696fe1c86f9d53c68c7ffddf122e5c7578 (patch) | |
tree | 69853f3cb4e272894afed73157eec5aeb742b952 /src | |
parent | 433a4c95d4d24b852bc7b6e0dbe1b77e02f401df (diff) | |
download | SkyHanniChangelogBuilder-4161d7696fe1c86f9d53c68c7ffddf122e5c7578.tar.gz SkyHanniChangelogBuilder-4161d7696fe1c86f9d53c68c7ffddf122e5c7578.tar.bz2 SkyHanniChangelogBuilder-4161d7696fe1c86f9d53c68c7ffddf122e5c7578.zip |
using category enum v2
Diffstat (limited to 'src')
-rw-r--r-- | src/main/kotlin/Main.kt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt index 4b03f9d..b26c52d 100644 --- a/src/main/kotlin/Main.kt +++ b/src/main/kotlin/Main.kt @@ -184,7 +184,7 @@ private fun createPrint( if (outputType == OutputType.DISCORD_PUBLIC && category == Category.INTERNAL) continue val changes = allChanges.filter { it.category == category } if (changes.isEmpty()) continue - list.add("### " + category.name) + list.add("### " + category.changeLogName) if (outputType == OutputType.DISCORD_PUBLIC) { list.add("```diff") } @@ -194,7 +194,7 @@ private fun createPrint( OutputType.GITHUB -> " (${change.prLink})" OutputType.DISCORD_INTERNAL -> " [PR](<${change.prLink}>)" } - val changePrefix = getChangePrefix(category.name, outputType) + val changePrefix = getChangePrefix(category, outputType) list.add("$changePrefix${change.text} - ${change.author}$pr") for (s in change.extraInfo) { list.add("$extraInfoPrefix$s") @@ -216,15 +216,15 @@ private fun createPrint( return list } -fun getChangePrefix(name: String, outputType: OutputType): String = when (outputType) { +fun getChangePrefix(category: Category, outputType: OutputType): String = when (outputType) { OutputType.DISCORD_INTERNAL -> "- " OutputType.GITHUB -> "+ " - OutputType.DISCORD_PUBLIC -> when (name) { - "New Features" -> "+ " - "Improvements" -> "+ " - "Fixes" -> "~ " - "Removed Features" -> "- " - else -> error("impossible change prefix") + OutputType.DISCORD_PUBLIC -> when (category) { + Category.NEW -> "+ " + Category.IMPROVEMENT -> "+ " + Category.FIX -> "~ " + Category.REMOVED -> "- " + Category.INTERNAL -> error("internal not in discord public") } } |