fix(quick-dev): delete stale .md renders before rebuilding

render.py rebuilds from scratch per the docstring, but
makedirs(exist_ok=True) only overwrites files that still exist in
the source — stale outputs from renamed/deleted source files linger
in _bmad/render/bmad-quick-dev/ forever. Remove every .md in the
render dir before the render loop; keep the dir itself and any
non-.md files.

Part of plan-quick-dev-python-config-hardening.md (F5).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Verkhovsky 2026-04-21 23:53:52 -07:00
parent 6f849e00a3
commit 972b79852f
1 changed files with 4 additions and 0 deletions

View File

@ -131,6 +131,10 @@ def main():
out_dir = posixpath.join(root, "_bmad", "render", skill_name) out_dir = posixpath.join(root, "_bmad", "render", skill_name)
os.makedirs(out_dir, exist_ok=True) os.makedirs(out_dir, exist_ok=True)
for fname in os.listdir(out_dir):
if fname.endswith(".md"):
os.remove(posixpath.join(out_dir, fname))
count = 0 count = 0
for fname in sorted(os.listdir(script_dir)): for fname in sorted(os.listdir(script_dir)):
if not fname.endswith(".md") or fname == "SKILL.md": if not fname.endswith(".md") or fname == "SKILL.md":