diff --git a/v2/cmd/generate-checksum/main.go b/v2/cmd/generate-checksum/main.go index a33ee6c00..6990e86d9 100644 --- a/v2/cmd/generate-checksum/main.go +++ b/v2/cmd/generate-checksum/main.go @@ -29,6 +29,11 @@ func main() { if err != nil || d.IsDir() { return nil } + pathIndex := path[strings.Index(path, "nuclei-templates/")+17:] + // Ignore items starting with dots + if strings.HasPrefix(pathIndex, ".") { + return nil + } data, err := os.ReadFile(path) if err != nil { return nil @@ -37,7 +42,7 @@ func main() { _, _ = io.Copy(h, bytes.NewReader(data)) hash := hex.EncodeToString(h.Sum(nil)) - _, _ = file.WriteString(path[strings.Index(path, "nuclei-templates/")+17:]) + _, _ = file.WriteString(pathIndex) _, _ = file.WriteString(":") _, _ = file.WriteString(hash) _, _ = file.WriteString("\n")