diff options
author | Tobias Roeser <le.petit.fou@web.de> | 2019-08-26 21:44:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-26 21:44:33 +0200 |
commit | 78b5123328c4227dc31d772133573e09e99c81eb (patch) | |
tree | 5b6daa23c03af231476e5e98a7e7827851a126ca | |
parent | e391829cfd30769e36115a47e89fe110e7df3fe7 (diff) | |
download | mill-78b5123328c4227dc31d772133573e09e99c81eb.tar.gz mill-78b5123328c4227dc31d772133573e09e99c81eb.tar.bz2 mill-78b5123328c4227dc31d772133573e09e99c81eb.zip |
Fixed StringIndexOutOfBoundsException in case of short artifact names (#681)
Fixes https://github.com/lihaoyi/mill/issues/673
-rwxr-xr-x | scalalib/src/GenIdeaImpl.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scalalib/src/GenIdeaImpl.scala b/scalalib/src/GenIdeaImpl.scala index 04cd5158..f737d473 100755 --- a/scalalib/src/GenIdeaImpl.scala +++ b/scalalib/src/GenIdeaImpl.scala @@ -215,7 +215,7 @@ case class GenIdeaImpl(evaluator: Evaluator, val artifactId = pom.module.name.value val scalaArtifactRegex = ".*_[23]\\.[0-9]{1,2}".r - val artifactWithScalaVersion = artifactId.substring(artifactId.length - 5) match { + val artifactWithScalaVersion = artifactId.substring(artifactId.length - math.min(5, artifactId.length)) match { case scalaArtifactRegex(_*) => artifactId case _ => artifactId + "_2.12" } |