Skip to content

Commit

Permalink
use String interpolation instead of String.format
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Oct 8, 2024
1 parent dc25a9e commit 311c2b7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/src/main/scala/g8.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ object G8 {
}
} catch {
case e: Exception =>
println("Falling back to file copy for %s: %s" format (in.toString, e.getMessage))
println(s"Falling back to file copy for ${in}: ${e.getMessage}")
FileUtils.copyFile(in, out)
}
allCatch opt {
Expand Down Expand Up @@ -505,10 +505,10 @@ object G8 {
}
.foreach { case (in, optionOut) =>
optionOut match {
case None => println("Skipping ignored file: %s" format in.toString)
case None => println(s"Skipping ignored file: ${in}")
case Some(out) => {
if (out.exists && !forceOverwrite) {
println("Skipping existing file: %s" format out.toString)
println(s"Skipping existing file: ${out}")
} else {
out.getParentFile.mkdirs()
if (G8.verbatim(in, parameters, tmpl))
Expand All @@ -535,7 +535,7 @@ object G8 {
}
}

Right("Template applied in %s" format (base.toString))
Right(s"Template applied in ${base}")
}

def copyScaffolds(sf: File, output: File): Unit = {
Expand Down

0 comments on commit 311c2b7

Please sign in to comment.