fix: resolve lighthouse routes from canonical TCS root
This commit is contained in:
parent
8ac1ef2357
commit
02217d11ea
5 changed files with 135 additions and 5 deletions
|
|
@ -10,9 +10,25 @@ import subprocess
|
|||
from pathlib import Path
|
||||
|
||||
SCRIPT_PATH = Path(__file__).resolve()
|
||||
REPO_ROOT = SCRIPT_PATH.parents[4]
|
||||
SHARED_ROOT = SCRIPT_PATH.parents[3]
|
||||
if (REPO_ROOT / "routing" / "lighthouse-path-registry.json").is_file():
|
||||
LOCAL_SOURCE_ROOT = SCRIPT_PATH.parents[3]
|
||||
RUNTIME_ROOT = Path("/Volumes/JZAO/HoloLake/persona-runtime")
|
||||
POINTER = RUNTIME_ROOT / "TCS-ROOT.json"
|
||||
SHARED_ROOT = RUNTIME_ROOT / "shared"
|
||||
|
||||
|
||||
def canonical_repo_root() -> Path | None:
|
||||
if (LOCAL_SOURCE_ROOT / "routing" / "lighthouse-path-registry.json").is_file():
|
||||
return LOCAL_SOURCE_ROOT
|
||||
if POINTER.is_file() and not POINTER.is_symlink():
|
||||
value = json.loads(POINTER.read_text(encoding="utf-8"))
|
||||
candidate = Path(value.get("canonical_repo", ""))
|
||||
if (candidate / "routing" / "lighthouse-path-registry.json").is_file():
|
||||
return candidate
|
||||
return None
|
||||
|
||||
|
||||
REPO_ROOT = canonical_repo_root()
|
||||
if REPO_ROOT:
|
||||
DEFAULT_LIGHTHOUSE = REPO_ROOT / "routing" / "lighthouse-path-registry.json"
|
||||
DEFAULT_HOST_MAP = REPO_ROOT / "routing" / "host-skill-navigation-map.json"
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue