This commit is contained in:
Liang Ding 2023-05-05 09:46:17 +08:00
parent c62b1a102a
commit 6e864a2718
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 36 additions and 3 deletions

View file

@ -19,6 +19,7 @@ package model
import (
"crypto/sha1"
"fmt"
"os"
"path/filepath"
"github.com/88250/gulu"
@ -41,6 +42,11 @@ type Petal struct {
func LoadPetals() (ret []*Petal) {
petalDir := filepath.Join(util.DataDir, "storage", "petal")
if err := os.MkdirAll(petalDir, 0755); nil != err {
logging.LogErrorf("create petal dir [%s] failed: %s", petalDir, err)
return
}
confPath := filepath.Join(petalDir, "petals.json")
ret = []*Petal{}