Skip to content

Commit c78dcff

Browse files
authored
Merge pull request #166 from fahedouch/update-compose-env-var
2 parents e6bb854 + dce8265 commit c78dcff

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cli/options.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,19 @@ func WithDotEnv(o *ProjectOptions) error {
188188

189189
s, err := os.Stat(dotEnvFile)
190190
if os.IsNotExist(err) {
191+
if o.EnvFile != "" {
192+
return errors.Errorf("Couldn't find env file: %s", o.EnvFile)
193+
}
191194
return nil
192195
}
193196
if err != nil {
194197
return err
195198
}
196199

197200
if s.IsDir() {
198-
return nil
201+
if o.EnvFile != "" {
202+
return errors.Errorf("%s is a directory", dotEnvFile)
203+
}
199204
}
200205

201206
file, err := os.Open(dotEnvFile)

0 commit comments

Comments
 (0)