Douglas Douglas - 3 months ago 13
Scala Question

How can I make the "scalas" script runner more quiet?

I'm currently using the

scalas
script runner to make scripts in Scala. When I run a script that uses
scalas
, the output of my script always begins with

[info] Loading global plugins from /Users/me/.sbt/0.13/plugins
[info] Set current project to root-0cb4495327541b24b269 (in build file:/Users/me/.conscript/boot/0cb4495327541b24b269/)


Hence, even my little "Hello world!" program is way too verbose!

How can I suppress this "helpful" information that
scalas
wants to impart to me? I just want to see "Hello world!" output in my terminal window, and nothing else.

Answer

I was able to achieve this by modifying the scalas script. I did not use conscript to install scalas, but I rather followed the manual install instructions in the documentation. That is, I copied sbt/bin/sbt to sbt/bin/scalas and changed the last line from

run "$@"

to

run -Dsbt.main.class=sbt.ScriptMain --warn "$@"

Adding the --warn makes sure that I no longer see the usual info logs.