Merge pull request #7835 from Friendseeker/sbt-7020

[1.x] Throw exception when `sbt new` fails to find template
This commit is contained in:
eugene yokota 2024-10-27 13:57:55 -04:00 committed by GitHub
commit 2259598e5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -84,7 +84,9 @@ private[sbt] object TemplateCommandUtil {
hit
} match {
case Some(_) => // do nothing
case None => System.err.println("Template not found for: " + arguments.mkString(" "))
case None =>
val error = "Template not found for: " + arguments.mkString(" ")
throw new IllegalArgumentException(error)
}
private def tryTemplate(
@ -276,7 +278,8 @@ private[sbt] object TemplateCommandUtil {
case TypelevelToolkitSlug :: Nil => typelevelToolkitTemplate()
case SbtCrossPlatformSlug :: Nil => sbtCrossPlatformTemplate()
case _ =>
System.err.println("Local template not found for: " + arguments.mkString(" "))
val error = "Local template not found for: " + arguments.mkString(" ")
throw new IllegalArgumentException(error)
}
private final val defaultScalaV = "3.3.4"