From a484e5f46ca8e2eec01a25c1a18f631f41741cba Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 28 Aug 2026 16:39:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(load=5Fpath):=20app=E6=A0=B9=E4=BB=8E?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E8=87=AA=E8=BA=AB=E4=BD=8D=E7=BD=AE=E4=B8=8A?= =?UTF-8?q?=E6=BA=AF=E4=B8=89=E7=BA=A7=E8=A7=A3=E6=9E=90(~/pipeline?= =?UTF-8?q?=E5=9C=A8=E9=83=A8=E7=BD=B2=E6=9C=BA=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/load_path.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/load_path.py b/scripts/load_path.py index 68ad7fe..d5dc728 100644 --- a/scripts/load_path.py +++ b/scripts/load_path.py @@ -15,9 +15,19 @@ PATHS_LOGINED = [ def main(): - root = os.path.expanduser("~/pipeline") - if not os.path.isfile(os.path.join(root, "set_role_perm.py")): - print("ERROR: pipeline root not found") + # app root: 本脚本位于 /pkgs//scripts/,上溯三级即 app 根 + script_dir = os.path.dirname(os.path.abspath(__file__)) + candidates = [ + os.path.dirname(os.path.dirname(os.path.dirname(script_dir))), + os.path.expanduser("~/pipeline"), + ] + root = None + for c in candidates: + if os.path.isfile(os.path.join(c, "set_role_perm.py")): + root = c + break + if not root: + print("ERROR: pipeline root not found (set_role_perm.py missing)") sys.exit(1) set_perm = os.path.join(root, "set_role_perm.py") py = sys.executable