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():
|
def find_app_root():
|
||||||
for c in [os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
|
# 从 scripts/ 向上逐层查找 set_role_perm.py(位于 pipeline-app 根目录)
|
||||||
os.path.expanduser("~/pipeline")]:
|
d = os.path.dirname(os.path.abspath(__file__))
|
||||||
if os.path.isfile(os.path.join(c, "set_role_perm.py")):
|
for _ in range(6):
|
||||||
return c
|
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
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user