Skip to content

Commit cfb0bd9

Browse files
fix: edit rule paths (#2422)
Installation docs were calling edit rules without filtering for valid paths first. This PR fixes that.
1 parent 4954882 commit cfb0bd9

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pkg/tfgen/installation_docs.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,9 @@ func applyEditRules(contentBytes []byte, docFile string, g *Generator) ([]byte,
131131
reReplace(`block contains the following arguments`,
132132
`input has the following nested fields`),
133133
)
134-
var err error
135-
for _, rule := range edits {
136-
contentBytes, err = rule.Edit(docFile, contentBytes)
137-
if err != nil {
138-
return nil, err
139-
}
134+
contentBytes, err := edits.apply(docFile, contentBytes)
135+
if err != nil {
136+
return nil, err
140137
}
141138
return contentBytes, nil
142139
}

0 commit comments

Comments
 (0)