Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
WojciechMazur committed Apr 3, 2024
1 parent b55b957 commit ea7210a
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions project-builder/scala-cli/build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ import os.CommandResult
case class CliCommand[T](
command: Seq[String],
errHandler: (CommandResult, EvalResult.Failure) => EvalResult[T]
){
) {
override def toString(): String = s"${command.mkString(" ")}"
}
def cmd(args: String*) = CliCommand[Unit](args, (_, failure) => failure)
Expand All @@ -127,9 +127,9 @@ class CliTaskEvaluator(scalaVersion: String, repositoryDir: String, mavenRepoURL
}

def eval[T](task: CliCommand[T]): EvalResult[T] = {
val extraLibraryDependencies = Utils.extraLibraryDependencies(scalaVersion).map{
case Utils.LibraryDependency(org, artifact, version, scalaCrossVersion) =>
if(scalaCrossVersion) s"--dependency=$org::$artifact:$version"
val extraLibraryDependencies = Utils.extraLibraryDependencies(scalaVersion).map {
case Utils.LibraryDependency(org, artifact, version, scalaCrossVersion) =>
if (scalaCrossVersion) s"--dependency=$org::$artifact:$version"
else s"--dependency=$org:$artifact:$version"
}
val evalStart = System.currentTimeMillis()
Expand All @@ -146,9 +146,14 @@ class CliTaskEvaluator(scalaVersion: String, repositoryDir: String, mavenRepoURL
mavenRepoURL.map(s"--repository=" + _).toList,
extraLibraryDependencies
)
.call(check = false, stdout = os.Inherit, stderr = os.Pipe, env = Map(
"COURSIER_REPOSITORIES" -> s"central|sonatype:releases|sonatype:snapshots|sonatype-s01:snapshots|snapshots|${mavenRepoURL.getOrElse("")}"
))
.call(
check = false,
stdout = os.Inherit,
stderr = os.Pipe,
env = Map(
"COURSIER_REPOSITORIES" -> s"central|sonatype:releases|${mavenRepoURL.getOrElse("")}"
)
)
val result = proc.exitCode
val tookMillis = (System.currentTimeMillis() - evalStart).toInt
def nullT = null.asInstanceOf[T]
Expand Down

0 comments on commit ea7210a

Please sign in to comment.