fix: load_path find_app_root walk up to pipeline-app root
This commit is contained in:
parent
addfdabc76
commit
9bc5e81574
@ -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
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user