MCPcopy Create free account
hub / github.com/arctic-cli/interface / detectPlatformAndArch

Function detectPlatformAndArch

packages/arctic/script/postinstall.mjs:12–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10const require = createRequire(import.meta.url)
11
12function detectPlatformAndArch() {
13 // Map platform names
14 let platform
15 switch (os.platform()) {
16 case "darwin":
17 platform = "darwin"
18 break
19 case "linux":
20 platform = "linux"
21 break
22 case "win32":
23 platform = "windows"
24 break
25 default:
26 platform = os.platform()
27 break
28 }
29
30 // Map architecture names
31 let arch
32 switch (os.arch()) {
33 case "x64":
34 arch = "x64"
35 break
36 case "arm64":
37 arch = "arm64"
38 break
39 case "arm":
40 arch = "arm"
41 break
42 default:
43 arch = os.arch()
44 break
45 }
46
47 return { platform, arch }
48}
49
50function findBinary() {
51 const { platform, arch } = detectPlatformAndArch()

Callers 1

findBinaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected