Skip to content

Commit

Permalink
Merge pull request #247 from haarchri/feature/doc-fix-count
Browse files Browse the repository at this point in the history
feat(docs): fix doc generation
  • Loading branch information
haarchri authored Aug 2, 2023
2 parents 93d7b82 + e9ef734 commit caa74d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/registry/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func convertManifest2JSON(file *hcl.File, b *hclsyntax.Block) (string, error) {
return out.String(), nil
}

func (r *Resource) findExampleBlock(file *hcl.File, blocks hclsyntax.Blocks, resourceName *string, exactMatch bool) error {
func (r *Resource) findExampleBlock(file *hcl.File, blocks hclsyntax.Blocks, resourceName *string, exactMatch bool) error { //nolint:gocyclo
dependencies := make(map[string]string)
for _, b := range blocks {
depKey := fmt.Sprintf("%s.%s", b.Labels[0], b.Labels[1])
Expand All @@ -187,7 +187,7 @@ func (r *Resource) findExampleBlock(file *hcl.File, blocks hclsyntax.Blocks, res
continue
}

if suffixMatch(b.Labels[0], *resourceName, 1) {
if suffixMatch(b.Labels[0], *resourceName, 1) || (strings.Contains(*resourceName, b.Labels[0]) && strings.Count(*resourceName, "_") == strings.Count(b.Labels[0], "_")) {
*resourceName = b.Labels[0]
exactMatch = true
} else {
Expand Down

0 comments on commit caa74d2

Please sign in to comment.