Files
modulus/tools/modulus_tool.py
T
khodowany 2750dd7f3a
publish / publish (push) Successful in 53m2s
Initial public khodo snapshot
2026-09-04 19:30:11 -05:00

21 lines
636 B
Python

import pathlib
import sys
def repo_root():
current = pathlib.Path(__file__).resolve()
for candidate in (current.parent, *current.parents):
if (candidate / "modulus.json").is_file():
return candidate
raise SystemExit("could not find modulus.json from Modulus tool wrapper")
def run(command):
root = repo_root()
runtime_root = root / "build" / "build_common" / "modulus"
source_root = root / "modulus" / "cli.py"
if source_root.is_file():
sys.path.insert(0, str(root))
elif runtime_root.exists():
sys.path.insert(0, str(runtime_root))
import modulus.cli
raise SystemExit(modulus.cli.main(command))