Add a YAML extraction script

This is intended for use with pkg/embeddedyamls/yamls.go from the
operator.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
This commit is contained in:
Stephen Kitt
2025-01-20 12:25:48 -05:00
committed by Thomas Pantelis
parent 967541e5ec
commit 4967ab1b72
Executable
+18
View File
@@ -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
}