Skip to content

Commit

Permalink
ignore .env if not a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerxxx committed Apr 14, 2023
1 parent 270da2d commit 40e8ce1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cli/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ func GetEnvFromFile(currentEnv map[string]string, workingDir string, filenames [
}
dotEnvFile = abs

s, err := os.Stat(dotEnvFile)
if os.IsNotExist(err) {
return envMap, nil
}
if s.IsDir() {
return envMap, nil
}

b, err := os.ReadFile(dotEnvFile)
if os.IsNotExist(err) {
if len(filenames) > 0 {
Expand Down

0 comments on commit 40e8ce1

Please sign in to comment.