Skip to content

Commit

Permalink
Avoid duplicate extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
jzbrooks committed Oct 12, 2024
1 parent 2a6f87e commit 28f15d2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vgo/src/main/kotlin/com/jzbrooks/vgo/Vgo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ import java.io.File
import java.nio.file.Path
import java.nio.file.Paths
import javax.xml.parsers.DocumentBuilderFactory
import kotlin.io.path.createDirectories
import kotlin.io.path.createFile
import kotlin.io.path.exists
import kotlin.io.path.isDirectory
import kotlin.io.path.isRegularFile
import kotlin.io.path.isSameFileAs
import kotlin.io.path.nameWithoutExtension
import kotlin.math.absoluteValue
import kotlin.math.roundToInt

Expand Down Expand Up @@ -154,8 +157,8 @@ class Vgo(

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

Expand Down

0 comments on commit 28f15d2

Please sign in to comment.