fix folder adding

Sorry dane I missed that I nested those.
This commit is contained in:
Michael Parker 2020-04-14 00:03:16 -04:00
parent 65102966a1
commit df9c4835c4

View File

@ -350,21 +350,17 @@ func (c *Configuration) EnsureFilePermissions() error {
}
// create the daemon-data dir if it doesn't exist
p, file := path.Split(c.System.Data)
p, _ := path.Split(c.System.Data)
if _, err := os.Stat(c.System.Data); err != nil {
// if file doesn't exist
if os.IsNotExist(err) {
//
if _, err = os.Stat(c.System.Data); err != nil {
if file == "" {
if err = os.Mkdir(p, 0755); err != nil {
}
zap.S().Debugf("created %s folder", c.System.Data)
}
}
}
}
files, err := ioutil.ReadDir(c.System.Data)
if err != nil {