Skip to content
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

Create a way to provide environment variables #1097

Open
greatvovan opened this issue Sep 19, 2024 · 0 comments
Open

Create a way to provide environment variables #1097

greatvovan opened this issue Sep 19, 2024 · 0 comments

Comments

@greatvovan
Copy link

As Scala lacks methods for setting environment variables, simulation of them for code that consumes environment is complicated.

I got away with build settings like that:

fork in run := true

envVars in run := Map(
  "MY_VAR" -> "MY VALUE"
)

Example:

println(sys.env("MY_VAR"))
Thread.sleep(5000)

The problems with that approach are:

  • the console output of the program is displayed differently than in normal mode (sbt prefix);
  • after program termination the bottom panel switches to the program output (which stays empty forever), effectively hiding the real output.

I suggest to add a tab where the user could set environment variables in an intuitive way.

@scalacenter scalacenter deleted a comment Sep 19, 2024
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

No branches or pull requests

1 participant