chore: Remove obsolete scripts and enhance path configuration

- Deleted `check_md_files.py` and `fix_cursor_md_issue.py` as they are no longer needed.
- Added new functions in `path_config.py` for better path management, including actions log and run_cli paths.
- Updated various modules to utilize the new path configuration, ensuring consistency and maintainability across the project.
This commit is contained in:
Your Name committed 2025-12-28 20:55:34 +08:00
1 parent b9849b9f5a
commit bdf9312bc9
58 files changed
+2472 -854

No files matched your search

+29 -7
View File
@@ -10,8 +10,9 @@ import time
from dataclasses import dataclass
from typing import Optional
import path_config
CONFIG_PATH = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "config", "config.json")
CONFIG_PATH = path_config.get_config_path()
def find_adb_executable() -> str:
@@ -717,9 +718,16 @@ class Runner:
# 如果 wait_minutes=0,表示无限循环模式
wait_minutes_arg = str(params.wait_minutes) if params.wait_minutes > 0 else "0"
run_cli_path = path_config.get_run_cli_path()
if not os.path.exists(run_cli_path):
raise FileNotFoundError(
f"未找到 run_cli.py 文件。\n"
f"预期路径: {run_cli_path}\n"
f"请确保 run_cli.py 位于项目根目录。"
)
cmd = [
sys.executable,
os.path.join(os.path.dirname(__file__), "run_cli.py"),
run_cli_path,
"--y-pianyi",
str(params.y_pianyi),
"--wait-minutes",
@@ -808,7 +816,7 @@ class Runner:
encoding="utf-8",
errors="replace",
env=env,
cwd=os.path.dirname(__file__),
cwd=path_config.PROJECT_ROOT,
)
with self._lock:
@@ -857,9 +865,16 @@ class Runner:
if seconds <= 0:
seconds = 90
run_cli_path = path_config.get_run_cli_path()
if not os.path.exists(run_cli_path):
raise FileNotFoundError(
f"未找到 run_cli.py 文件。\n"
f"预期路径: {run_cli_path}\n"
f"请确保 run_cli.py 位于项目根目录。"
)
cmd = [
sys.executable,
os.path.join(os.path.dirname(__file__), "run_cli.py"),
run_cli_path,
"--test-yanghao-flow",
"--test-yanghao-flow-seconds",
str(seconds),
@@ -886,7 +901,7 @@ class Runner:
encoding="utf-8",
errors="replace",
env=env,
cwd=os.path.dirname(__file__),
cwd=path_config.PROJECT_ROOT,
)
with self._lock:
@@ -932,9 +947,16 @@ class Runner:
raise RuntimeError("已经在运行")
text = str(text or "").strip()
run_cli_path = path_config.get_run_cli_path()
if not os.path.exists(run_cli_path):
raise FileNotFoundError(
f"未找到 run_cli.py 文件。\n"
f"预期路径: {run_cli_path}\n"
f"请确保 run_cli.py 位于项目根目录。"
)
cmd = [
sys.executable,
os.path.join(os.path.dirname(__file__), "run_cli.py"),
run_cli_path,
"--test-comment",
]
if text:
@@ -961,7 +983,7 @@ class Runner:
encoding="utf-8",
errors="replace",
env=env,
cwd=os.path.dirname(__file__),
cwd=path_config.PROJECT_ROOT,
)
with self._lock: