"""Rewrites kong.yml from trustpin_attest.lua (the Lua is embedded verbatim)."""
import pathlib

here = pathlib.Path(__file__).parent
lua = (here / "trustpin_attest.lua").read_text()
yml = (here / "kong.yml").read_text()
head = yml.split("            - |\n")[0]
body = "\n".join("              " + line if line else "" for line in lua.splitlines())
(here / "kong.yml").write_text(head + "            - |\n" + body + "\n")
