Skip to content

Commit f62e1b4

Browse files
committed
Log a warning, when the workspace directory doesn't exist
1 parent 86ad84a commit f62e1b4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,25 @@ final class SelfCheckAlg[F[_]](config: Config)(implicit
3737
def checkAll: F[Unit] =
3838
for {
3939
_ <- logger.info("Run self checks")
40+
_ <- checkWorkspaceDirectory
4041
_ <- checkGitBinary
4142
_ <- checkScalafixBinary
4243
_ <- checkScalafmtBinary
4344
_ <- checkUrlChecker
4445
} yield ()
4546

47+
private def checkWorkspaceDirectory: F[Unit] =
48+
F.whenA(!config.workspace.exists)(
49+
logger.warn(
50+
"""
51+
|The workspace is empty.
52+
|This is expected if this is your first Scala Steward run.
53+
|Make sure to preserve the workspace between runs for all features to work as expected.
54+
|https://github.com/scala-steward-org/scala-steward/blob/main/docs/faq.md#why-doesnt-self-hosted-scala-steward-close-obsolete-prs
55+
|""".stripMargin
56+
)
57+
)
58+
4659
private def checkGitBinary: F[Unit] =
4760
logger.attemptWarn.log_(execFailedMessage("git")) {
4861
gitAlg.version.flatMap(output => logger.info(s"Using $output"))

0 commit comments

Comments
 (0)