fix(load_path): ROOT改脚本相对定位——写死~/pipeline在生产HOME=/d/doit下崩溃
This commit is contained in:
parent
521d3ca75a
commit
51b92210db
@ -2,7 +2,8 @@
|
|||||||
"""Register all pipeline module RBAC permissions in one run."""
|
"""Register all pipeline module RBAC permissions in one run."""
|
||||||
import sys, os, asyncio
|
import sys, os, asyncio
|
||||||
|
|
||||||
ROOT = os.path.expanduser("~/pipeline")
|
# 应用根目录 = scripts/ 的上一级(不写死 ~/pipeline,各环境 HOME 不同)
|
||||||
|
ROOT = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
|
||||||
sys.path.insert(0, os.path.join(ROOT, "py3", "lib", "python3.10", "site-packages"))
|
sys.path.insert(0, os.path.join(ROOT, "py3", "lib", "python3.10", "site-packages"))
|
||||||
sys.path.insert(0, ROOT)
|
sys.path.insert(0, ROOT)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user