dbInitCreateAuthDirectory creates the directory structure pointed to by the auth file if it does not already exist.
(authFileName string)
| 195 | |
| 196 | // dbInitCreateAuthDirectory creates the directory structure pointed to by the auth file if it does not already exist. |
| 197 | func dbInitCreateAuthDirectory(authFileName string) error { |
| 198 | dir, _ := filepath.Split(authFileName) |
| 199 | // If there's no directory, then we have nothing to create |
| 200 | if len(dir) == 0 { |
| 201 | return nil |
| 202 | } |
| 203 | fullDir, err := fileSystem.Abs(dir) |
| 204 | if err != nil { |
| 205 | return err |
| 206 | } |
| 207 | if exists, _ := fileSystem.Exists(fullDir); !exists { |
| 208 | return fileSystem.MkDirs(fullDir) |
| 209 | } |
| 210 | return nil |
| 211 | } |