Ignore dotfiles when building overlay list.
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user