opencode-config/.opencode/templates/cli/hooks/post_gen_project.py
Sergey 35b6c6e542
feat(infra): cookiecutter templates backend fullstack cli (#235)
* feat(infra): backend cookiecutter template with fastapi tortoise

* feat(infra): cli cookiecutter template with typer entry point

* feat(infra): fullstack cookiecutter template with sveltekit frontend

* test(infra): cookiecutter template tests and render fixes

* style(infra): ruff cleanup for cookiecutter template tests

* style(infra): ruff format cookiecutter template tests

* fix(infra): handle use_db no use_auth no in cookiecutter

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-08-03 17:06:24 +03:00

31 lines
No EOL
715 B
Python

"""Post-generation hook for the cli cookiecutter template.
The cli template is unconditional (no use_auth/use_db flags affect it),
but the hook is kept for parity with backend/fullstack so the same
contract applies.
"""
from __future__ import annotations
import shutil
from pathlib import Path
PROJECT_DIR = Path.cwd()
def _remove(path: str) -> None:
"""Remove a file or directory relative to the generated project root."""
p = PROJECT_DIR / path
if p.is_dir():
shutil.rmtree(p, ignore_errors=True)
elif p.exists():
p.unlink()
def main() -> None:
"""No conditional files for the cli template yet — placeholder."""
return None
if __name__ == "__main__":
main()