()
| 85 | } |
| 86 | |
| 87 | export 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 | |
| 111 | export function getBinaryName(platform: string): string { |
| 112 | return platform.startsWith('win32') ? 'claude.exe' : 'claude' |
no test coverage detected