kt2ts2.kt - minor style refactor
This commit is contained in:
parent
7cd6c4a47a
commit
8342a923a8
1 changed files with 5 additions and 5 deletions
|
|
@ -19,6 +19,7 @@ import org.intellij.lang.annotations.Language
|
||||||
|
|
||||||
|
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
|
val outputFilename = args.firstOrNull()
|
||||||
|
|
||||||
val config = KxsTsConfig(
|
val config = KxsTsConfig(
|
||||||
typeAliasTyping = BrandTyping
|
typeAliasTyping = BrandTyping
|
||||||
|
|
@ -56,14 +57,13 @@ fun main(args: Array<String>) {
|
||||||
|
|
||||||
val definitions = gen2.generate(
|
val definitions = gen2.generate(
|
||||||
KafkatorioPacket.serializer(),
|
KafkatorioPacket.serializer(),
|
||||||
// KafkatorioKeyedPacketKey2.serializer(),
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
when (val filename = args.firstOrNull()) {
|
when (outputFilename) {
|
||||||
null -> println(definitions)
|
null -> println(definitions)
|
||||||
else -> {
|
else -> {
|
||||||
val outPath = Path(filename)
|
val outPath = Path(outputFilename)
|
||||||
outPath.createDirectories()
|
outPath.createDirectories()
|
||||||
val outFile = outPath.resolve("kafkatorio-schema.ts").toFile()
|
val outFile = outPath.resolve("kafkatorio-schema.ts").toFile()
|
||||||
outFile.printWriter().use {
|
outFile.printWriter().use {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue