Skip to content

Commit

Permalink
fix: edit rule paths (#2422)
Browse files Browse the repository at this point in the history
Installation docs were calling edit rules without filtering for valid
paths first. This PR fixes that.
  • Loading branch information
guineveresaenger authored Sep 18, 2024
1 parent 4954882 commit cfb0bd9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pkg/tfgen/installation_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,9 @@ func applyEditRules(contentBytes []byte, docFile string, g *Generator) ([]byte,
reReplace(`block contains the following arguments`,
`input has the following nested fields`),
)
var err error
for _, rule := range edits {
contentBytes, err = rule.Edit(docFile, contentBytes)
if err != nil {
return nil, err
}
contentBytes, err := edits.apply(docFile, contentBytes)
if err != nil {
return nil, err
}
return contentBytes, nil
}
Expand Down

0 comments on commit cfb0bd9

Please sign in to comment.