Closed sakulstra closed 2 years ago
Hi @sakulstra, could you provide a minimal working example so I can understand your issue better?
@allan2 sorry when trying to create a reproduction noticed an issue in my implementation which lead to the issue mentioned above :sweat_smile:
Hey reporting this here as it seems to be the successor of
dotenv
crate that's currently used in https://github.com/foundry-rs/foundryI noticed some weird behavior of
dotenv
which i think is still present indotenvy
:sweat_smile:Will correctly load
TEST
, but when i useexport TEST=
(to pollute the env) it will no longer work which is somewhat unexpected.I understand that
machine env
>.env
by design, but having an empty env defined is imo very close to not having an env defined so .env should take precedence. All other dotenv libraries i ever faced behaved differently.tl;dr; I think it make sense to enhance this check https://github.com/allan2/dotenvy/blob/master/dotenv/src/iter.rs#L28 to be either error or empty string, so that
.env
takes precedence over predefined empty strings.