Closed slhck closed 3 years ago
Oh, I realize this should be added to https://github.com/levibostian/dotenv/ and not here. Moving there.
The work to support this feature has been completed on the CLI end. Now, all that needs to happen is update the CLI version in the plugin and this will ship!
Deployed with v1.3.0
https://github.com/levibostian/dotenv-android/releases/tag/1.3.0
This works perfectly now for my use case. Thank you!
This is a feature request.
When I add empty env variables like:
Or:
These are not resolved, and therefore not available in the program code.
Feature: Make empty variables available in
Env
, but simply set to an empty string (in case of""
), ornull
(in case of no value) so that you can programmatically deal with them and determine absence of the values.Otherwise I have no easy way to provide optional values.
Consider the case where this
.env
file is necessary for a certain functionality only, so the values don't have to be set at all times. I cannot just remove them completely, as the code wouldn't compile anymore. I also cannot set them to bogus values likefoo
, because I would have to provide extra check likeif Env.elasticsearchTestUrl == "foo"
instead of a semantically more correctif Env.elasticsearchTestUrl == null
, or add a check for.length() == 0
.