Skip to content

Commit

Permalink
fix order of env file loading
Browse files Browse the repository at this point in the history
  • Loading branch information
joshspicer authored Jan 4, 2024
1 parent 35f33b5 commit d09a380
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit d09a380

Please sign in to comment.