Files
TGC-Hammer/toolflow/src/main/scala/com/minres/tgc/hammer/FileUtils.scala

12 lines
234 B
Scala

package com.minres.tgc.hammer
import os.*
object FileUtils {
def changeExtension(path: os.Path, newExt: String): os.Path = {
val baseName = path.baseName
val newName = s"$baseName.$newExt"
path / os.up / newName
}
}