Skip to content

Commit 837272c

Browse files
committed
warn when running console instead of repl
1 parent 9a79c14 commit 837272c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

project/Build.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,6 +2138,16 @@ object Build {
21382138
// default.
21392139
addCommandAlias("publishLocal", "scala3-bootstrapped/publishLocal"),
21402140
repl := (`scala3-compiler-bootstrapped` / repl).value,
2141+
(Compile / console) := (Compile / console).dependsOn(Def.task {
2142+
import _root_.scala.io.AnsiColor._
2143+
val msg = "`console` uses the reference Scala version. Use `repl` instead."
2144+
val f = "" * (msg.length + 2)
2145+
val box =
2146+
s"""$f
2147+
|║ ${BOLD}$msg$RESET
2148+
|╚$f""".stripMargin
2149+
streams.value.log.warn(box)
2150+
}).value,
21412151
).
21422152
settings(
21432153
publish / skip := true

0 commit comments

Comments
 (0)