feat: separate writable data dir from program dir (LAN update groundwork)

- add get_data_dir() with CMBOT_DATA_DIR override, fallback to program dir
- point config/logs/output at the data root; resources stay on program root
- harden config/template writes with parents=True for a deep data root
- add docs/10-lan-update.md (LAN auto-update design); default install root
  %LOCALAPPDATA%\CMBot for elevation-free self-update

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-17 16:29:47 +08:00
co-authored by Claude Opus 4.8
parent 7a1b9d8330
commit 76f2c6dd5b
4 changed files with 288 additions and 13 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ def _save_custom_templates(templates: List[Template]):
"""Write custom templates to JSON. Logs error on failure, does not raise."""
path = _templates_file()
try:
path.parent.mkdir(exist_ok=True)
path.parent.mkdir(parents=True, exist_ok=True)
payload = {
"templates": [
{