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 can't be read if not explicitly set by user #383

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

ndeloof
Copy link
Collaborator

@ndeloof ndeloof commented Apr 4, 2023

fixes docker/compose#10430

added a test case so we don't re-introduce this regression in the future

I'm a bit sad we can't (in a portable way) just check err == EISDIR after os.ReadFile and need to preventively check os.Stat.

@ndeloof ndeloof force-pushed the dotEnv branch 2 times, most recently from bbce9c3 to b1ae8d9 Compare April 4, 2023 08:18
Copy link
Member

@milas milas left a comment

Choose a reason for hiding this comment

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

LGTM!

func TestGetEnvFromFile(t *testing.T) {
wd := t.TempDir()
f := filepath.Join(wd, ".env")
err := os.Mkdir(f, 0700)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
err := os.Mkdir(f, 0700)
err := os.Mkdir(f, 0o700)

to make the linter happy

@ndeloof ndeloof merged commit dff689d into compose-spec:master Apr 17, 2023
@ndeloof ndeloof deleted the dotEnv branch April 17, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants