From 9bc5e81574adbd7231854852ebf0acae7dce6c4b Mon Sep 17 00:00:00 2001 From: p Date: Thu, 13 Aug 2026 17:49:23 +0800 Subject: [PATCH] fix: load_path find_app_root walk up to pipeline-app root --- scripts/load_path.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/load_path.py b/scripts/load_path.py index 2adb9bd..a645bed 100644 --- a/scripts/load_path.py +++ b/scripts/load_path.py @@ -112,10 +112,15 @@ PATHS_LOGINED = [ def find_app_root(): - for c in [os.path.dirname(os.path.dirname(os.path.abspath(__file__))), - os.path.expanduser("~/pipeline")]: - if os.path.isfile(os.path.join(c, "set_role_perm.py")): - return c + # 从 scripts/ 向上逐层查找 set_role_perm.py(位于 pipeline-app 根目录) + d = os.path.dirname(os.path.abspath(__file__)) + for _ in range(6): + if os.path.isfile(os.path.join(d, "set_role_perm.py")): + return d + parent = os.path.dirname(d) + if parent == d: + break + d = parent return None