mirror of https://github.com/daffainfo/nuclei.git
Do not show unparseable templates
parent
7ab9b0302f
commit
e1868d8661
|
@ -819,13 +819,15 @@ func (r *Runner) ListAvailableTemplates() {
|
||||||
func(path string, d *godirwalk.Dirent) error {
|
func(path string, d *godirwalk.Dirent) error {
|
||||||
if !d.IsDir() && strings.HasSuffix(path, ".yaml") {
|
if !d.IsDir() && strings.HasSuffix(path, ".yaml") {
|
||||||
t, err := r.parse(path)
|
t, err := r.parse(path)
|
||||||
switch tp := t.(type) {
|
if t != nil {
|
||||||
case *templates.Template:
|
switch tp := t.(type) {
|
||||||
r.logTemplateLoaded(tp.ID, tp.Info.Name, tp.Info.Author, tp.Info.Severity)
|
case *templates.Template:
|
||||||
case *workflows.Workflow:
|
r.logTemplateLoaded(tp.ID, tp.Info.Name, tp.Info.Author, tp.Info.Severity)
|
||||||
r.logTemplateLoaded(tp.ID, tp.Info.Name, tp.Info.Author, tp.Info.Severity)
|
case *workflows.Workflow:
|
||||||
default:
|
r.logTemplateLoaded(tp.ID, tp.Info.Name, tp.Info.Author, tp.Info.Severity)
|
||||||
gologger.Errorf("Could not parse file '%s': %s\n", path, err)
|
default:
|
||||||
|
gologger.Errorf("Could not parse file '%s': %s\n", path, err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue