Skip to content

Commit 6e01b11

Browse files
authored
Merge pull request #1897 from tegonal/improve-err-msg-scalafmt-not-on-PATH
improve error message in case git or scalafmt is not on the path
2 parents 8701a6d + a5f9a1d commit 6e01b11

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

modules/core/src/main/scala/org/scalasteward/core/application/SelfCheckAlg.scala

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,20 @@ final class SelfCheckAlg[F[_]](implicit
4141

4242
private def checkGitBinary: F[Unit] =
4343
gitAlg.version.attempt.flatMap {
44-
case Right(output) => logger.info(s"Using $output")
45-
case Left(throwable) => logger.warn(throwable)("Failed to execute git")
44+
case Right(output) => logger.info(s"Using $output")
45+
case Left(throwable) =>
46+
logger.warn(throwable)(
47+
"Failed to execute git -- make sure it is on the PATH; following the detailed exception:"
48+
)
4649
}
4750

4851
private def checkScalafmtBinary: F[Unit] =
4952
scalafmtAlg.version.attempt.flatMap {
50-
case Right(output) => logger.info(s"Using $output")
51-
case Left(throwable) => logger.warn(throwable)("Failed to execute scalafmt")
53+
case Right(output) => logger.info(s"Using $output")
54+
case Left(throwable) =>
55+
logger.warn(throwable)(
56+
"Failed to execute scalafmt -- make sure it is on the PATH; following the detailed exception:"
57+
)
5258
}
5359

5460
private def checkUrlChecker: F[Unit] =

0 commit comments

Comments
 (0)