From da44706994e724f4091a9baa846f71c2f42f4d47 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Tue, 20 Apr 2021 13:34:39 +0200 Subject: [PATCH] ignore .env if not a file Signed-off-by: Nicolas De Loof --- cli/options.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/options.go b/cli/options.go index beb385f1..4eff1e14 100644 --- a/cli/options.go +++ b/cli/options.go @@ -121,9 +121,14 @@ func WithDotEnv(o *ProjectOptions) error { } dotEnvFile = filepath.Join(dir, dotEnvFile) } - if _, err := os.Stat(dotEnvFile); os.IsNotExist(err) { + s, err := os.Stat(dotEnvFile) + if os.IsNotExist(err) { return nil } + if s.IsDir() { + return nil + } + file, err := os.Open(dotEnvFile) if err != nil { return err