/** * Where the repositories this run was pointed at are. * * **One place**, because two things need it and they must agree: the rebuild builds these, and the * receipt claims these. A receipt naming a repository the run did not build is exactly the * false coverage novox/hq 04-ISSUES/005 is about, and it would arrive by nobody's decision — just * two derivations drifting. * * Derived from the environment the suite is configured by, so a repository this run was not * pointed at is neither built nor claimed. */ import { dirname } from "node:path"; export interface Repositories { /** Absolute path to the repository root, by name. */ [name: string]: string; } export function repositories(env: NodeJS.ProcessEnv = process.env): Repositories { const found: Repositories = {}; found["mesh-lab"] = process.cwd(); const host = env["MESH_LAB_HOST_BINARY"]; if (host) found["mesh-host"] = dirname(host); const modules = env["MESH_LAB_MODULES"]; if (modules) found["mesh-control"] = dirname(dirname(modules)); return found; }