-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix non-zero exit code on error #338
Fix non-zero exit code on error #338
Conversation
@@ -121,6 +121,10 @@ class EffektConfig(args: Seq[String]) extends REPLConfig(args) { | |||
|
|||
def interpret(): Boolean = !server() && !compile() && !build() | |||
|
|||
def repl(): Boolean = filenames().isEmpty && !server() && !compile() | |||
|
|||
def exitOnError(): Boolean = !repl() && !server() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a semantic name for this? What characterizes these options? Being in batch mode?
In our meeting @marzipankaiser mentioned that this might kill |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried it locally on my machine.
It seems to do (close enough to) the right thing for me:
- running
effekt ...
terminates with useful error code (1 on error) - running
sbt
, thenproject effektJVM
, thenrun ...
does not terminate shell on error, generates compiled output correctly - running
sbt "effektJVM/run ..."
terminates with useful error code (1 on error) - running
sbt
, theneffektJVM/run ...
will terminate the sbt shell on error. While this is somewhat unexpected behaviour, I would not run into this in normal use, so I think this is a good compromise for now.
In Summary: LGTM.
This PR fixes issue #293.
If a message with error severity is logged in compilation/interpret/build mode, effekt now fails with code 1. If run as REPL or server, errors won't cause exits.