Skip to content

Commit

Permalink
Only load environment variables from local file if NOTIFIER_ENV is se…
Browse files Browse the repository at this point in the history
…t to "development"
  • Loading branch information
erdemyerebasmaz committed Nov 29, 2023
1 parent 60bea02 commit 3250276
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions breezsdk/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ import (
)

func main() {
// Read environment variables from breezsdk/cmd/config.env if the file is available
if err := godotenv.Load("config.env"); err != nil && !os.IsNotExist(err) {
log.Fatalln("Error loading .env file")
environment := os.Getenv("NOTIFIER_ENV")
// Read environment variables from breezsdk/cmd/config.env (if the file is available) on Dev environment
if environment == "development" {
if err := godotenv.Load("config.env"); err != nil && !os.IsNotExist(err) {
log.Fatalln("Error loading .env file")
}
}

var config config.Config
Expand Down

0 comments on commit 3250276

Please sign in to comment.