2016-11-21 12:24:50 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2016-12-11 13:50:01 +00:00
|
|
|
"log"
|
2016-12-08 19:45:26 +00:00
|
|
|
|
2016-12-11 13:50:01 +00:00
|
|
|
"github.com/dannyvankooten/ana/commands"
|
|
|
|
"github.com/dannyvankooten/ana/db"
|
|
|
|
"github.com/joho/godotenv"
|
2016-11-21 12:24:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2016-12-11 13:50:01 +00:00
|
|
|
// load .env file
|
|
|
|
err := godotenv.Load()
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal("Error loading .env file")
|
|
|
|
}
|
2016-11-22 21:33:50 +00:00
|
|
|
|
2016-12-11 13:50:01 +00:00
|
|
|
// setup database connection
|
2016-12-11 14:37:51 +00:00
|
|
|
conn, err := db.SetupDatabaseConnection()
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
2016-12-11 13:50:01 +00:00
|
|
|
defer conn.Close()
|
2016-11-22 19:57:16 +00:00
|
|
|
|
2016-12-11 13:50:01 +00:00
|
|
|
// parse & run cli commands
|
|
|
|
commands.Parse()
|
|
|
|
commands.Run()
|
2016-11-21 12:24:50 +00:00
|
|
|
}
|