This commit is contained in:
rob
2026-12-02 15:44:24 +00:00
parent cbcc9fa4b5
commit 8d01d02cc0
17 changed files with 125 additions and 35 deletions
+11 -5
View File
@@ -8,7 +8,8 @@ from pathlib import Path
ROOT = Path(__file__).resolve().parent
TOOLKIT = ROOT.parent.parent / "toolkits/testing/scripts"
FORGE = ROOT.parent.parent
TOOLKIT = FORGE / "toolkits/testing"
TOKEN_FILES = (".env.example", "docker-compose.yml", "react/index.html",
".bortstack/testing.json",
"react/src/config/site.js", "react/src/components/Logo/Logo.jsx",
@@ -31,10 +32,15 @@ def generate(name, destination, git_init=False):
raise ValueError("destination parent must already exist")
target.mkdir()
try:
shutil.copytree(ROOT / "source", target, symlinks=False, dirs_exist_ok=True)
shutil.copytree(ROOT / "boilerplate", target, dirs_exist_ok=True)
for tool_name in ("testtask.sh", "testrunner.sh", "target.py", "toolkit.py"):
shutil.copy2(TOOLKIT / tool_name, target / "scripts" / tool_name)
ignore_cache = shutil.ignore_patterns("__pycache__")
shutil.copytree(ROOT / "source", target, dirs_exist_ok=True, ignore=ignore_cache)
shutil.copytree(ROOT / "boilerplate", target, dirs_exist_ok=True, ignore=ignore_cache)
for tool_name in ("testtask.sh", "testrunner.sh"):
shutil.copy2(TOOLKIT / "scripts" / tool_name, target / "scripts" / tool_name)
for module in ("target.py", "toolkit.py"):
shutil.copy2(TOOLKIT / "runtime" / module, target / ".bortstack/testing" / module)
shutil.copy2(FORGE / "scripts/create-chatgpt-snapshot.py",
target / ".bortstack/create-chatgpt-snapshot.py")
values = {"__PROJECT_NAME__": name, "__APP_SLUG__": slug,
"__DATABASE_NAME__": slug.replace("-", "_")}
for relative in TOKEN_FILES: