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:
@@ -56,7 +56,7 @@ def save_config(data):
|
||||
config_file = get_config_path(_CONFIG_FILENAME)
|
||||
|
||||
try:
|
||||
config_file.parent.mkdir(exist_ok=True)
|
||||
config_file.parent.mkdir(parents=True, exist_ok=True)
|
||||
with open(str(config_file), "w", encoding="utf-8") as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=2)
|
||||
logger.info("Config saved to %s", config_file)
|
||||
|
||||
Reference in New Issue
Block a user