From 4d23ad4e85cd253c0d3cc2c4c4d7da6e95f5baf7 Mon Sep 17 00:00:00 2001 From: mptyl Date: Tue, 11 Aug 2026 19:06:04 +0200 Subject: [PATCH] fix: resolve the built thothctl binary per platform --- backend/scripts/p2-acceptance.mjs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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");