com.lunatech.cmt.Releasables.scala Maven / Gradle / Ivy
The newest version!
package com.lunatech.cmt
import sbt.io.IO as sbtio
import sbt.io.syntax.*
import scala.util.Using.Releasable
object Releasables:
final case class TmpDir(directory: File)
object TmpDir:
def apply(): TmpDir = TmpDir(sbtio.createTemporaryDirectory)
given Releasable[TmpDir] with {
def release(resource: TmpDir): Unit = sbtio.delete(resource.directory)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy