Output order into separate dict file

This commit is contained in:
theaspect 2025-03-15 18:33:45 +07:00
parent 432ee4d045
commit 49df752ef8

View File

@ -44,6 +44,8 @@ fun main(vararg args: String) {
entry.deleteIfExists()
}
FileOutputStream(File(output, "dict.sql")).bufferedWriter().use { dict ->
parsed.entries.forEachIndexed { index, (text, type) ->
println("Writing ${type.fileName}")
val outputFile = File(output, type.fileName)
@ -52,8 +54,11 @@ fun main(vararg args: String) {
throw IllegalArgumentException("File already exists $outputFile")
}
dict.write("-- ${type.fileName}\n")
FileOutputStream(outputFile).bufferedWriter().use {
it.write("-- Order $index\n" + text.trim())
it.write(text.trim())
}
}
}
}