Skip to content

Commit

Permalink
Fix lookup precedence
Browse files Browse the repository at this point in the history
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
  • Loading branch information
ulyssessouza committed Jul 4, 2022
1 parent a313a1e commit 1347fed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 0 additions & 4 deletions dotenv/parser.go
Expand Up @@ -37,7 +37,6 @@ func parseBytes(src []byte, out map[string]string, lookupFn LookupFn) error {
}

if inherited {

value, ok := lookupFn(key)
if ok {
out[key] = value
Expand All @@ -50,9 +49,6 @@ func parseBytes(src []byte, out map[string]string, lookupFn LookupFn) error {
if err != nil {
return err
}
if lookUpValue, ok := lookupFn(key); ok {
value = lookUpValue
}

out[key] = value
cutset = left
Expand Down
3 changes: 3 additions & 0 deletions loader/loader.go
Expand Up @@ -623,6 +623,9 @@ func resolveEnvironment(serviceConfig *types.ServiceConfig, workingDir string, l
environment := types.MappingWithEquals{}

if len(serviceConfig.EnvFile) > 0 {
if serviceConfig.Environment == nil {
serviceConfig.Environment = types.MappingWithEquals{}
}
for _, envFile := range serviceConfig.EnvFile {
filePath := absPath(workingDir, envFile)
file, err := os.Open(filePath)
Expand Down

0 comments on commit 1347fed

Please sign in to comment.