Skip to content

Commit 5e9e5e9

Browse files
authored
warn when running console instead of repl (#19729)
<img width="510" alt="image" src="https://github.com/lampepfl/dotty/assets/119636/92d30ef1-179d-430a-88fa-588b606e3d9a"> ----- re #19174 (comment)
2 parents c32846c + 837272c commit 5e9e5e9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

project/Build.scala

+10
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)