mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-17 04:22:23 +03:00
Force dbPath to be relative to main executable
This commit is contained in:
parent
c9742181ff
commit
10221b5471
@ -1,7 +1,10 @@
|
||||
package db_storm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
||||
"github.com/asdine/storm"
|
||||
@ -16,7 +19,12 @@ var (
|
||||
|
||||
func Db() *storm.DB {
|
||||
once.Do(func() {
|
||||
err := os.MkdirAll(conf.Sonic.DbPath, 0700)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
dbPath := path.Join(conf.Sonic.DbPath, "storm.db")
|
||||
dbPath = fmt.Sprintf(".%c%s", filepath.Separator, dbPath)
|
||||
instance, err := storm.Open(dbPath)
|
||||
log.Debug("Opening Storm DB from: " + dbPath)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user