Throw when template not found

This commit is contained in:
friendseeker 2024-10-26 22:10:48 -07:00
parent a46dfc0f4b
commit 7d674f6c93
No known key found for this signature in database
GPG Key ID: 7DD5039728A27160
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"