fix: resolve the built thothctl binary per platform
This commit is contained in:
@@ -815,9 +815,12 @@ async function writeInstallationFiles(ctx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function thothctlBinaryPath(repositoryRoot) {
|
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 = [
|
const candidates = [
|
||||||
join(repositoryRoot, "tools", "thothctl", "bin", "thothctl"),
|
join(repositoryRoot, "dist", "thothctl", `thothctl-${platform}-${arch}${suffix}`),
|
||||||
join(repositoryRoot, "dist", "thothctl", "bin", "thothctl"),
|
join(repositoryRoot, "tools", "thothctl", "bin", `thothctl${suffix}`),
|
||||||
];
|
];
|
||||||
for (const candidate of candidates) if (existsSync(candidate)) return candidate;
|
for (const candidate of candidates) if (existsSync(candidate)) return candidate;
|
||||||
throw new Error("built thothctl binary is unavailable");
|
throw new Error("built thothctl binary is unavailable");
|
||||||
|
|||||||
Reference in New Issue
Block a user