MCPcopy
hub / github.com/claude-code-best/claude-code / getPlatform

Function getPlatform

src/utils/nativeInstaller/installer.ts:87–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85}
86
87export function getPlatform(): string {
88 // Use env.platform which already handles platform detection and defaults to 'linux'
89 const os = env.platform
90
91 const arch =
92 process.arch === 'x64' ? 'x64' : process.arch === 'arm64' ? 'arm64' : null
93
94 if (!arch) {
95 const error = new Error(`Unsupported architecture: ${process.arch}`)
96 logForDebugging(
97 `Native installer does not support architecture: ${process.arch}`,
98 { level: 'error' },
99 )
100 throw error
101 }
102
103 // Check for musl on Linux and adjust platform accordingly
104 if (os === 'linux' && envDynamic.isMuslEnvironment()) {
105 return `linux-${arch}-musl`
106 }
107
108 return `${os}-${arch}`
109}
110
111export function getBinaryName(platform: string): string {
112 return platform.startsWith('win32') ? 'claude.exe' : 'claude'

Callers 15

runPowerShellCommandFunction · 0.85
isCwdChangingCmdletFunction · 0.85
validatePathFunction · 0.85
bashToolHasPermissionFunction · 0.85
getCommandAllowlistFunction · 0.85
runFunction · 0.85
defaultBindings.tsFile · 0.85
getReservedShortcutsFunction · 0.85
SandboxDependenciesTabFunction · 0.85
ConfigFunction · 0.85

Calls 1

logForDebuggingFunction · 0.50

Tested by

no test coverage detected