diff --git a/backend/scripts/p2-acceptance.mjs b/backend/scripts/p2-acceptance.mjs index aaa640ef..0be7e594 100644 --- a/backend/scripts/p2-acceptance.mjs +++ b/backend/scripts/p2-acceptance.mjs @@ -815,9 +815,12 @@ async function writeInstallationFiles(ctx) { } function thothctlBinaryPath(repositoryRoot) { + const platform = { darwin: "darwin", linux: "linux", win32: "windows" }[process.platform] ?? "linux"; + const arch = { x64: "amd64", arm64: "arm64" }[process.arch] ?? "amd64"; + const suffix = platform === "windows" ? ".exe" : ""; const candidates = [ - join(repositoryRoot, "tools", "thothctl", "bin", "thothctl"), - join(repositoryRoot, "dist", "thothctl", "bin", "thothctl"), + join(repositoryRoot, "dist", "thothctl", `thothctl-${platform}-${arch}${suffix}`), + join(repositoryRoot, "tools", "thothctl", "bin", `thothctl${suffix}`), ]; for (const candidate of candidates) if (existsSync(candidate)) return candidate; throw new Error("built thothctl binary is unavailable");