Skip to content

Commit

Permalink
Eval symlinks for .env path
Browse files Browse the repository at this point in the history
  • Loading branch information
florensie committed Dec 31, 2020
1 parent 3bcbe9c commit 4cfd204
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ func main() {
if err != nil {
log.Fatalf("error getting executable path: %s", err)
}
exPath := filepath.Dir(ex)
exPath, err := filepath.EvalSymlinks(filepath.Dir(ex))
if err != nil {
panic(err)
}

log.Printf("Looking for .env file in %s", exPath)

// Load config and initialize
err = godotenv.Load(".env", filepath.Join(exPath, ".env"))
Expand Down

0 comments on commit 4cfd204

Please sign in to comment.