1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

nodeConfStore: create dir on start

This commit is contained in:
Sergey Cherepanov 2023-04-17 17:10:15 +02:00 committed by Mikhail Iudin
parent 1616766b4b
commit 6f5b0b04c2
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
2 changed files with 5 additions and 1 deletions

View file

@ -30,6 +30,9 @@ type configGetter interface {
func (n *nodeConfStore) Init(a *app.App) (err error) {
n.path = a.MustComponent("config").(configGetter).GetNodeConfStorePath()
if e := os.Mkdir(n.path, 0755); e != nil && !os.IsExist(e) {
return e
}
return
}

View file

@ -7,6 +7,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"os"
"path/filepath"
"testing"
"time"
)
@ -74,7 +75,7 @@ type config struct {
}
func (c config) GetNodeConfStorePath() string {
return c.path
return filepath.Join(c.path, "nodeconf")
}
func (c config) Init(a *app.App) (err error) {