19
20
// PathsByDir returns a list of paths to directories within the schema subdirectory that have versioned schemas in them
21
>
func PathsByDir(dbSubDir string) []string {
embed.go
22
>
logger := log.NewCLILogger()
23
>
efs := Assets()
24
>
dirs := make([]string, 0)
25
>
err := fs.WalkDir(efs, dbSubDir, func(path string, d fs.DirEntry, err error) error {
26
>
if err != nil {
27
return err
28
}
30
>
if d.Name() == "versioned" {
31
>
dirs = append(dirs, filepath.ToSlash(filepath.Dir(path)))
32
>
return fs.SkipDir
33
>
}
34
}
36
})
38
logger.Error("error walking embedded schema file system tree, could not generate valid paths", tag.Error(err))
39
}
41
}
42