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