fix folder adding
Sorry dane I missed that I nested those.
This commit is contained in:
parent
65102966a1
commit
df9c4835c4
|
@ -350,21 +350,17 @@ func (c *Configuration) EnsureFilePermissions() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// create the daemon-data dir if it doesn't exist
|
// 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 _, err := os.Stat(c.System.Data); err != nil {
|
||||||
// if file doesn't exist
|
// if file doesn't exist
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
//
|
//
|
||||||
if _, err = os.Stat(c.System.Data); err != nil {
|
|
||||||
if file == "" {
|
|
||||||
if err = os.Mkdir(p, 0755); err != nil {
|
if err = os.Mkdir(p, 0755); err != nil {
|
||||||
}
|
}
|
||||||
zap.S().Debugf("created %s folder", c.System.Data)
|
zap.S().Debugf("created %s folder", c.System.Data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
files, err := ioutil.ReadDir(c.System.Data)
|
files, err := ioutil.ReadDir(c.System.Data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user