Update db_management/db_management.go
Some checks failed
Bot Unit Tests / test (push) Has been cancelled
Some checks failed
Bot Unit Tests / test (push) Has been cancelled
This commit is contained in:
@@ -12,7 +12,12 @@ var DB *sql.DB
|
|||||||
func InitDB() {
|
func InitDB() {
|
||||||
var err error
|
var err error
|
||||||
// Öffnet bot.db im aktuellen Verzeichnis
|
// Öffnet bot.db im aktuellen Verzeichnis
|
||||||
DB, err = sql.Open("sqlite", "./bot.db")
|
dbPath := os.Getenv("DB_PATH")
|
||||||
|
if dbPath == "" {
|
||||||
|
dbPath = "./bot.db"
|
||||||
|
}
|
||||||
|
|
||||||
|
DB, err = sql.Open("sqlite", dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user