refactor: migrate all config paths to ~/.mytoolkit with MYTOOLKIT_HOME support

This commit is contained in:
Zhengshou Lai
2026-06-04 00:52:25 +08:00
parent 3a47e6963d
commit 2d2ff45fca
3 changed files with 10 additions and 6 deletions
+3 -1
View File
@@ -3,6 +3,7 @@
import base64
import imaplib
import json
import os
import re
import smtplib
from datetime import datetime
@@ -16,7 +17,8 @@ import click
from bin.utils import handle_errors
CONFIG_PATH = Path.home() / ".config" / "mytoolkit" / "mail.json"
_HOME = Path(os.environ.get("MYTOOLKIT_HOME", Path.home() / ".mytoolkit"))
CONFIG_PATH = _HOME / "mail.json"
def load_config():
+3 -1
View File
@@ -1,11 +1,13 @@
"""External templates registry for md→pdf / md→docx conversion."""
import json
import os
from pathlib import Path
import click
CONFIG_PATH = Path.home() / ".config" / "mytoolkit" / "templates.json"
_HOME = Path(os.environ.get("MYTOOLKIT_HOME", Path.home() / ".mytoolkit"))
CONFIG_PATH = _HOME / "templates.json"
def _read() -> dict: