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

OverLoad: local variables do not override environment variables #14

Closed
5nord opened this issue May 19, 2022 · 0 comments · Fixed by #15
Closed

OverLoad: local variables do not override environment variables #14

5nord opened this issue May 19, 2022 · 0 comments · Fixed by #15

Comments

@5nord
Copy link
Contributor

5nord commented May 19, 2022

When using override functions like OverLoad local variables do not override environment variables anymore, since #12.

Example 1

$ export A="fromEnv"
$ cat .env
A="fromFile"
B="$A"

Expected Behaviour

After using OverLoad, variable B should have value fromFile.

Actual Behaviour

Variable B has value fromEnv.

Example 2: Recursive variable expansion

$ export B="fromEnv"
$ cat .env
A="$B$C"
B="fromFile"
C="fnord"

What is the expected behaviour, when a reference is resolved before its definition? I would argue it should be fromEnv,
since gotenv evaluates environment files line by line.

subosito pushed a commit that referenced this issue May 22, 2022
This commit adds an override-flag to make local variables override
environment variables.

Closes #14.
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 a pull request may close this issue.

1 participant