Skip to content

Commit

Permalink
Add a YAML extraction script
Browse files Browse the repository at this point in the history
This is intended for use with pkg/embeddedyamls/yamls.go from the
operator.

Signed-off-by: Stephen Kitt <[email protected]>
  • Loading branch information
skitt authored and tpantelis committed Jan 20, 2025
1 parent 967541e commit 4967ab1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions extract-yamls
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/awk -f

# Start of a file entry
/= `/ {
outfile = gensub("_yaml$", ".yaml", "1", $1)
print "Writing " outfile
print substr($0, index($0, "`") + 1) > outfile
next
}

/^`$/ {
outfile = ""
next
}

outfile != "" {
print >> outfile
}

0 comments on commit 4967ab1

Please sign in to comment.