Merge pull request #382 from griznog/wwctl-overlay-list-ignore-dotfiles

Ignore dotfiles when building overlay list.
This commit is contained in:
Christian Goll
2022-04-12 08:21:06 +02:00
committed by GitHub

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())
}
}