Skip to content

Commit

Permalink
bug fix for env file
Browse files Browse the repository at this point in the history
  • Loading branch information
TimothyYe committed Sep 8, 2017
1 parent 3b8f156 commit 3039987
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ func getExecutePath() string {

func loadEnv() {
exPath := getExecutePath()
envPath := fmt.Sprintf("%s/.env", exPath)

// if .env file doesn't exist, just return
if _, err := os.Stat(fmt.Sprintf("%s/.env", exPath)); os.IsNotExist(err) {
return
}

err := godotenv.Load()
err := godotenv.Load(envPath)
if err != nil {
log.Fatal("Error loading .env file")
return
Expand Down

0 comments on commit 3039987

Please sign in to comment.