Avoid adding empty array, ensure warning is shown to the user.

This commit is contained in:
Manuel Bua 2020-07-18 18:55:52 +02:00
parent 29cd509809
commit 0833e21a17

View File

@ -171,13 +171,14 @@ func (r *Runner) RunEnumeration() {
// directory couldn't be walked
if err != nil {
gologger.Warningf("Could not find templates in directory '%s': %s\n", absPath, err)
gologger.Labelf("Could not find templates in directory '%s': %s\n", absPath, err)
continue
}
// couldn't find templates in directory
if len(matches) == 0 {
gologger.Warningf("Error, no templates were found in '%s'.\n", absPath)
gologger.Labelf("Error, no templates were found in '%s'.\n", absPath)
continue
}
allTemplates = append(allTemplates, matches...)