修复路径

This commit is contained in:
zhang hongbo 2026-01-16 10:58:22 +08:00
parent cbb1cc4767
commit bf621f2e87

View File

@ -30,20 +30,16 @@ class IntegratedPipeline:
self.docs_path = "" # Docs 项目路径
self.main_project_path = "" # Unity 主项目路径
# 获取当前工具所在的项目根目录自动检测IntegratedTool -> PythonWorkSpace -> 项目根目录)
if getattr(sys, 'frozen', False):
# exe 模式
self.tool_root = Path(sys.executable).parent.parent.parent.resolve()
else:
# 开发模式 - 当前文件在 PythonWorkSpace/IntegratedTool/
self.tool_root = Path(__file__).parent.parent.parent.resolve()
# 获取配置文件路径支持exe模式
if getattr(sys, 'frozen', False):
app_dir = Path(os.path.dirname(sys.executable))
else:
app_dir = Path(__file__).parent
# 获取当前工具所在的项目根目录自动检测IntegratedTool -> PythonWorkSpace -> 项目根目录)
# app_dir 是 IntegratedTool 目录,根目录在其两层上级
self.tool_root = app_dir.parent.parent.resolve()
self.config_file = app_dir / "pipeline_config.json"
self.gen_py_dir = app_dir / "gen-py" # 临时Python代码目录