Fix MustDir config type to create directory
This commit is contained in:
parent
59aa6af767
commit
391681447e
1 changed files with 4 additions and 0 deletions
|
|
@ -34,6 +34,10 @@ func (u *MustDir) Validate() error {
|
||||||
return fmt.Errorf("path name must not be empty")
|
return fmt.Errorf("path name must not be empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := os.MkdirAll(val, 0750); err != nil {
|
||||||
|
return fmt.Errorf("%s can't be created (%w)", val, err)
|
||||||
|
}
|
||||||
|
|
||||||
finfo, err := os.Stat(val)
|
finfo, err := os.Stat(val)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("%s does not exist", val)
|
return fmt.Errorf("%s does not exist", val)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue