MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / getPlatformSpec

Function getPlatformSpec

scripts/download-node.mjs:88–105  ·  view source on GitHub ↗
(version, platform = PLATFORM, arch = ARCH)

Source from the content-addressed store, hash-verified

86 * win32 arm64 → node-v<ver>-win-arm64.zip
87 */
88export function getPlatformSpec(version, platform = PLATFORM, arch = ARCH) {
89 const base = `node-v${version}`;
90 if (platform === "darwin") {
91 const distArch = arch === "arm64" ? "arm64" : "x64";
92 return { name: `${base}-darwin-${distArch}`, ext: "tar.gz" };
93 }
94 if (platform === "linux") {
95 const distArch = arch === "arm64" ? "arm64" : "x64";
96 return { name: `${base}-linux-${distArch}`, ext: "tar.gz" };
97 }
98 if (platform === "win32") {
99 const distArch = arch === "arm64" ? "arm64" : "x64";
100 return { name: `${base}-win-${distArch}`, ext: "zip" };
101 }
102 throw new Error(
103 `Unsupported platform for Node download: ${platform}/${arch}`,
104 );
105}
106
107// ── Version resolution ───────────────────────────────────────────────────────
108

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected