MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / ensure_roles_file

Function ensure_roles_file

scripts/runtime_bootstrap.py:48–63  ·  view source on GitHub ↗
(root_dir: Path = PROJECT_ROOT)

Source from the content-addressed store, hash-verified

46
47
48def ensure_roles_file(root_dir: Path = PROJECT_ROOT) -> Path:
49 data_dir = root_dir / "data"
50 roles_path = data_dir / "roles.json"
51 if roles_path.exists():
52 return roles_path
53
54 template_path = root_dir / "config" / "roles.example.json"
55 if template_path.exists():
56 shutil.copyfile(template_path, roles_path)
57 return roles_path
58
59 roles_path.write_text(
60 json.dumps(DEFAULT_ROLES_TEMPLATE, ensure_ascii=False, indent=2) + "\n",
61 encoding="utf-8",
62 )
63 return roles_path
64
65
66def _database_has_required_tables(db_path: Path) -> bool:

Callers 1

bootstrap_runtimeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected