Ignore dotfiles when building overlay list.

This commit is contained in:
griznog
2022-04-11 11:15:25 -05:00
parent ebfce59900
commit 75e075ab52

View File

@@ -111,6 +111,7 @@ Get all overlays present in warewulf
func FindOverlays() ([]string, error) {
var ret []string
var files []os.FileInfo
dotfilecheck, _ := regexp.Compile(`^\..*`)
files, err := ioutil.ReadDir(OverlaySourceTopDir())
if err != nil {
@@ -119,7 +120,9 @@ func FindOverlays() ([]string, error) {
for _, file := range files {
wwlog.Printf(wwlog.DEBUG, "Evaluating overlay source: %s\n", file.Name())
if file.IsDir() {
isdotfile := dotfilecheck.MatchString(file.Name())
if (file.IsDir()) && !(isdotfile) {
ret = append(ret, file.Name())
}
}