diff options
author | Steve Manuel <nilslice@gmail.com> | 2020-01-01 17:14:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-01 17:14:32 -0700 |
commit | 9bc41b703131aa42ca64265ab6fdeadc37841e66 (patch) | |
tree | 138e6b7d6f8bd5c879eff61ce85df95506546003 /system/db | |
parent | 45730ba5b4de56fed27f79f8c822bb59d41f7a38 (diff) | |
parent | 6ee81caea4649d3fc3bb6b5bde0628cb91c8e6f5 (diff) |
Merge pull request #333 from mangelajo/env-vars-for-dirs
Allow data directories outside pwd
Diffstat (limited to 'system/db')
-rw-r--r-- | system/db/init.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/system/db/init.go b/system/db/init.go index 31e9f3f..f08e55f 100644 --- a/system/db/init.go +++ b/system/db/init.go @@ -5,6 +5,9 @@ package db import ( "log" + "path/filepath" + + "github.com/ponzu-cms/ponzu/system/cfg" "github.com/ponzu-cms/ponzu/system/item" "github.com/ponzu-cms/ponzu/system/search" @@ -46,7 +49,8 @@ func Init() { } var err error - store, err = bolt.Open("system.db", 0666, nil) + systemDb := filepath.Join(cfg.DataDir(),"system.db") + store, err = bolt.Open(systemDb, 0666, nil) if err != nil { log.Fatalln(err) } |