feat(portability): add __file__-anchored WORKSPACE_ROOT discovery, cross-OS font resolver, and public HTTP onboarding quickstart (v1.2.0)
This commit is contained in:
1 parent
f8235a2037
commit
4e38541fbf
7 files changed
+227
-103
No files matched your search
@@ -105,9 +105,17 @@ def load_ledger(path: Path) -> dict[str, Any]:
|
||||
raise SystemExit(f"error: ledger at {path} is unreadable ({exc}); run `reset` to start over")
|
||||
if not isinstance(data, dict) or not isinstance(data.get("sources"), list):
|
||||
raise SystemExit(f"error: ledger at {path} has an unexpected shape; run `reset`")
|
||||
cfg = load_workspace_config()
|
||||
for entry in data["sources"]:
|
||||
if "local_path" not in entry and isinstance(entry.get("url"), str) and entry["url"].startswith("/"):
|
||||
entry["local_path"] = entry["url"]
|
||||
raw_u = entry["url"]
|
||||
if Path(raw_u).exists():
|
||||
entry["local_path"] = raw_u
|
||||
elif raw_u.startswith("/workspace/"):
|
||||
rebased = cfg.workspace_root / raw_u[len("/workspace/") :]
|
||||
entry["local_path"] = rebased.as_posix() if rebased.exists() else raw_u
|
||||
else:
|
||||
entry["local_path"] = raw_u
|
||||
return data
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user