You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for pointing that out! The README was outdated. Here's an updated example tailored to your use case:
importio.github.klahap.dotenv.DotEnvBuilderval envVars =DotEnvBuilder.dotEnv {
// addSystemEnv() // uncomment this line if you want to include system environment variables
addFile("$rootDir/.env")
}
envVars.get("HOME") // = 127.0.0.1// or
envVars.getOrThrow("HOME") // = 127.0.0.1
Please note that environment variables loaded this way are only accessible during the build process, such as in your build.gradle.kts. These variables will not be available at the runtime of the application.
If I have a file
.env
withShould I just use
System.getenv('HOME')
to read the variable home? What is the way you intented?Best,
Mike
The text was updated successfully, but these errors were encountered: