Skip to content

Commit

Permalink
optimise the regex a bit
Browse files Browse the repository at this point in the history
Signed-off-by: shubhindia <shubhindia123@gmail.com>
  • Loading branch information
shubhindia committed Oct 17, 2023
1 parent d2f06f9 commit 72d29bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/transformer/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func Print(name, path string, trailing string, data []byte, toStdout, generateJS
file = filepath.Join(path, file)

// simple hack to remove status from the output
re := regexp.MustCompile(`status:[\s\S]*?(?:---|$)`)
re := regexp.MustCompile(`(?s)status:.*`)
data = re.ReplaceAll(data, nil)

if err := os.WriteFile(file, data, 0644); err != nil {
Expand Down

0 comments on commit 72d29bd

Please sign in to comment.