From d09a380d580bd4c84ea99f82d84c1c83a029aa98 Mon Sep 17 00:00:00 2001 From: Josh Spicer Date: Thu, 4 Jan 2024 20:09:25 +0000 Subject: [PATCH] fix order of env file loading --- server/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/main.go b/server/main.go index ca5cece..ab975fd 100644 --- a/server/main.go +++ b/server/main.go @@ -19,14 +19,14 @@ var ( func main() { fmt.Printf("[jarvis] %s, %s\n", version, commit) - // Get first argument to determine mode - mode := determineMode() - err := godotenv.Load() if err != nil { log.Printf("NOTE: No .env file loaded\n") } + // Get first argument to determine mode + mode := determineMode() + _, isRelease := os.LookupEnv("RELEASE") if isRelease { log.Printf("Mode: Release\n") @@ -97,6 +97,7 @@ func determineMode() string { return os.Args[1] } mode := os.Getenv("JARVIS_MODE") + fmt.Printf("Mode: %s\n", mode) if mode != "" { return mode }