Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbrooks committed Oct 12, 2024
1 parent 46c13d2 commit 2a6f87e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions vgo/src/main/kotlin/com/jzbrooks/vgo/Vgo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class Vgo(
return handleFiles(inputOutputMap, writerOptions)
}

private fun pairOutputs(): Map<File, Path> {
return if (options.output.isNotEmpty()) {
private fun pairOutputs(): Map<File, Path> =
if (options.output.isNotEmpty()) {
options.input.zip(options.output) { a, b ->
Pair(File(a), Paths.get(b))
}
Expand All @@ -76,7 +76,6 @@ class Vgo(
Pair(File(a), Paths.get(b))
}
}.toMap()
}

private fun handleFile(
input: File,
Expand Down Expand Up @@ -153,11 +152,12 @@ class Vgo(
optimizationRegistry?.apply(graphic)
}

val output = when(this.options.format) {
"vd" -> outputPath.resolveSibling("${outputPath.fileName}.xml")
"svg" -> outputPath.resolveSibling("${outputPath.fileName}.svg")
else -> outputPath
}.toFile()
val output =
when (this.options.format) {
"vd" -> outputPath.resolveSibling("${outputPath.fileName}.xml")
"svg" -> outputPath.resolveSibling("${outputPath.fileName}.svg")
else -> outputPath
}.toFile()

if (output.parentFile?.exists() == false) output.parentFile.mkdirs()
if (!output.exists()) output.createNewFile()
Expand Down

0 comments on commit 2a6f87e

Please sign in to comment.