From e39299bfe26d8437a12c0abcdbe73d607608e445 Mon Sep 17 00:00:00 2001 From: Andy Hsu Date: Tue, 21 Feb 2023 17:45:15 +0800 Subject: [PATCH] fix(local): missed type of `MkdirPerm` (923937b) --- drivers/local/driver.go | 3 +++ drivers/local/meta.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/local/driver.go b/drivers/local/driver.go index 644063eb..85b12bec 100644 --- a/drivers/local/driver.go +++ b/drivers/local/driver.go @@ -35,6 +35,9 @@ func (d *Local) Config() driver.Config { } func (d *Local) Init(ctx context.Context) error { + if d.MkdirPerm == 0 { + d.MkdirPerm = 777 + } if !utils.Exists(d.GetRootPath()) { return fmt.Errorf("root folder %s not exists", d.GetRootPath()) } diff --git a/drivers/local/meta.go b/drivers/local/meta.go index a39aa084..bdbe9278 100644 --- a/drivers/local/meta.go +++ b/drivers/local/meta.go @@ -9,7 +9,7 @@ type Addition struct { driver.RootPath Thumbnail bool `json:"thumbnail" required:"true" help:"enable thumbnail"` ShowHidden bool `json:"show_hidden" default:"true" required:"false" help:"show hidden directories and files"` - MkdirPerm uint32 `json:"mkdir_perm" default:"777"` + MkdirPerm uint32 `json:"mkdir_perm" type:"number" default:"777"` } var config = driver.Config{