Load .env from executable path
This commit is contained in:
parent
aaa155ca2f
commit
d046d06e61
6
main.go
6
main.go
@ -19,11 +19,7 @@ func main() {
|
|||||||
exeDir := filepath.Dir(exePath)
|
exeDir := filepath.Dir(exePath)
|
||||||
|
|
||||||
// Load .env file
|
// Load .env file
|
||||||
err = godotenv.Load(filepath.Join(exeDir, ".env"))
|
godotenv.Load(filepath.Join(exeDir, ".env"))
|
||||||
if err != nil {
|
|
||||||
fmt.Println("Error loading .env file:", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize app
|
// Initialize app
|
||||||
app, err := app.NewApp()
|
app, err := app.NewApp()
|
||||||
|
Loading…
Reference in New Issue
Block a user