Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@alterationx10
Copy link
Contributor

When targeting Scala.js and/or Scala Native, it would be nice to have the exit code of the process set correctly, as it is with the JVM.

I believe Scala native already supports using System.exit, java.lang.System is listed here: https://scala-native.org/en/stable/lib/javalib.html , and here is a corresponding test where it is used https://github.com/scala-native/scala-native/blob/main/scripted-tests/run/system-exit/src/main/scala/Exit.scala

For nodejs, and this api https://nodejs.org/api/process.html#processexitcode_1, we can gracefully set an exit code. From the docs:

A number which will be the process exit code, when the process either exits gracefully, or is exited via process.exit without specifying a code.

I've built + run these changes locally to confirm, but I'd be happy to set up a corresponding test suite with some guidance of similar tests that might already be in place.

@adamgfraser adamgfraser merged commit 31a5c3f into zio:series/2.x Mar 8, 2023
@alterationx10 alterationx10 deleted the exit-codes branch March 8, 2023 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants