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

ignore .env if not a file #389

Closed
wants to merge 1 commit into from

Conversation

Strangerxxx
Copy link

.env should only be loaded when an actual file

it was previously fixed by #124

however it took into regression

(again) fix docker-archive/compose-cli#1575

@Strangerxxx Strangerxxx requested a review from ndeloof as a code owner April 14, 2023 11:10
Signed-off-by: Daniel Chaplin <[email protected]>
Copy link
Collaborator

@ndeloof ndeloof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #383 which already address this issue

@@ -277,6 +277,14 @@ func GetEnvFromFile(currentEnv map[string]string, workingDir string, filenames [
}
dotEnvFile = abs

s, err := os.Stat(dotEnvFile)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this MUST be guarded by if len(dotEnvFiles) == 0 so that we don't ignore envfile set explicitly by user

@ndeloof ndeloof closed this Apr 17, 2023
@ndeloof
Copy link
Collaborator

ndeloof commented Apr 17, 2023

see #383

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 this pull request may close these issues.

docker compose fails if there is a folder called .env
2 participants