Output order into separate dict file
This commit is contained in:
parent
432ee4d045
commit
49df752ef8
@ -44,16 +44,21 @@ fun main(vararg args: String) {
|
|||||||
entry.deleteIfExists()
|
entry.deleteIfExists()
|
||||||
}
|
}
|
||||||
|
|
||||||
parsed.entries.forEachIndexed { index, (text, type) ->
|
FileOutputStream(File(output, "dict.sql")).bufferedWriter().use { dict ->
|
||||||
println("Writing ${type.fileName}")
|
|
||||||
val outputFile = File(output, type.fileName)
|
|
||||||
|
|
||||||
if (outputFile.exists()) {
|
parsed.entries.forEachIndexed { index, (text, type) ->
|
||||||
throw IllegalArgumentException("File already exists $outputFile")
|
println("Writing ${type.fileName}")
|
||||||
}
|
val outputFile = File(output, type.fileName)
|
||||||
|
|
||||||
FileOutputStream(outputFile).bufferedWriter().use {
|
if (outputFile.exists()) {
|
||||||
it.write("-- Order $index\n" + text.trim())
|
throw IllegalArgumentException("File already exists $outputFile")
|
||||||
|
}
|
||||||
|
|
||||||
|
dict.write("-- ${type.fileName}\n")
|
||||||
|
|
||||||
|
FileOutputStream(outputFile).bufferedWriter().use {
|
||||||
|
it.write(text.trim())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user