New ๐ŸŒŠ wave for @helm

Commit b4f4469d

b4f4469da707Merged

Anurag Agarwal <[email protected]> ยท 3 years ago ยท 1 file ยท ~1 modified

Description

Only use .env when it exists

Details

Commit
b4f4469da707
Parent
3f5f7d5b3ecb

cmd/helmwave/main.gomodifiedView file

@@ -7,9 +7,9 @@
77 "github.com/helmwave/helmwave/pkg/action"
88 logSetup "github.com/helmwave/helmwave/pkg/log"
99 helmwave "github.com/helmwave/helmwave/pkg/version"
10+ "github.com/joho/godotenv"
1011 log "github.com/sirupsen/logrus"
1112 "github.com/urfave/cli/v2"
12- "github.com/joho/godotenv"
1313 )
1414
1515 //nolint:gochecknoglobals // we need a global list of commands
@@ -30,9 +30,11 @@
3030 }
3131
3232 func main() {
33- err := godotenv.Load()
34- if err != nil {
35- log.Fatal("Error loading .env file")
33+ if _, err := os.Stat(".env"); err == nil {
34+ err = godotenv.Load()
35+ if err != nil {
36+ log.Fatal("Error loading .env file")
37+ }
3638 }
3739
3840 c := CreateApp()