From 1d9660c73d8b2be7bd693cf4ea2e2d7236d8bf67 Mon Sep 17 00:00:00 2001 From: hubian <908234780@qq.com> Date: Sat, 11 Apr 2026 13:14:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E6=8B=BC=E6=8E=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 476c981..18f9f6e 100644 --- a/app.py +++ b/app.py @@ -17,7 +17,8 @@ import urllib.error app = Flask(__name__) BASE_DIR = os.path.dirname(os.path.abspath(__file__)) -WORKSPACE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +WORKSPACE_DIR = os.path.dirname(BASE_DIR) # works目录 +ROOT_DIR = os.path.dirname(WORKSPACE_DIR) # workspace-coder目录 PROJECTS_FILE = os.path.join(BASE_DIR, 'projects.json') # 进程状态缓存 @@ -678,7 +679,7 @@ def api_start(project_id): if directory.startswith('/'): cwd = directory else: - cwd = os.path.join(WORKSPACE_DIR, directory) + cwd = os.path.join(ROOT_DIR, directory) if not os.path.exists(cwd): return jsonify({'error': f'目录不存在: {cwd}'}), 400 @@ -727,7 +728,7 @@ def api_run(project_id): if directory.startswith('/'): cwd = directory else: - cwd = os.path.join(WORKSPACE_DIR, directory) + cwd = os.path.join(ROOT_DIR, directory) cmd = project.get('run_cmd', '') if not cmd: