Skip to content

Commit

Permalink
fix: data dir not exists
Browse files Browse the repository at this point in the history
Signed-off-by: MicroOps-cn <[email protected]>
  • Loading branch information
MicroOps-cn committed Feb 8, 2025
1 parent 5d12fc8 commit 9428b48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ func (x *Config) Init(_ log.Logger) error {
if x.Storage.Default == nil {
o := gorm.NewSQLiteOptions()
o.Path = "data/idas.db"

if _, err := os.Stat("data"); os.IsNotExist(err) {
if err = os.MkdirAll("data", 0755); err != nil {
return err
}
}
x.Storage.Default = &Storage{
Name: "default",
Source: &Storage_Sqlite{
Expand Down

0 comments on commit 9428b48

Please sign in to comment.