mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 02:11:28 +00:00
fix: use aarch64 for CLIProxy arm assets
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* Platform Detector for CLIProxyAPI Binary Downloads
|
* Platform Detector for CLIProxyAPI Binary Downloads
|
||||||
*
|
*
|
||||||
* Detects OS and architecture to determine correct binary asset.
|
* Detects OS and architecture to determine correct binary asset.
|
||||||
* Supports 6 platforms: darwin/linux/windows x amd64/arm64
|
* Supports 6 platforms: darwin/linux/windows x amd64/aarch64
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -75,7 +75,7 @@ const OS_MAP: Record<string, SupportedOS | undefined> = {
|
|||||||
|
|
||||||
const ARCH_MAP: Record<string, SupportedArch | undefined> = {
|
const ARCH_MAP: Record<string, SupportedArch | undefined> = {
|
||||||
x64: 'amd64',
|
x64: 'amd64',
|
||||||
arm64: 'arm64',
|
arm64: 'aarch64',
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -103,7 +103,7 @@ export function detectPlatform(
|
|||||||
|
|
||||||
if (!arch) {
|
if (!arch) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unsupported CPU architecture: ${nodeArch}\n` + `Supported: x64 (amd64), arm64`
|
`Unsupported CPU architecture: ${nodeArch}\n` + `Supported: x64 (amd64), arm64 (aarch64)`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,7 +195,7 @@ export function isPlatformSupported(): boolean {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get human-readable platform description
|
* Get human-readable platform description
|
||||||
* @returns Description string (e.g., "macOS arm64")
|
* @returns Description string (e.g., "macOS aarch64")
|
||||||
*/
|
*/
|
||||||
export function getPlatformDescription(): string {
|
export function getPlatformDescription(): string {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import { PLUS_ONLY_PROVIDERS } from '../../types';
|
|||||||
describe('types.ts backward compatibility', () => {
|
describe('types.ts backward compatibility', () => {
|
||||||
it('exports all platform types', () => {
|
it('exports all platform types', () => {
|
||||||
const os: SupportedOS = 'darwin';
|
const os: SupportedOS = 'darwin';
|
||||||
const arch: SupportedArch = 'arm64';
|
const arch: SupportedArch = 'aarch64';
|
||||||
const ext: ArchiveExtension = 'tar.gz';
|
const ext: ArchiveExtension = 'tar.gz';
|
||||||
const info: PlatformInfo = {
|
const info: PlatformInfo = {
|
||||||
os,
|
os,
|
||||||
@@ -43,7 +43,7 @@ describe('types.ts backward compatibility', () => {
|
|||||||
extension: ext,
|
extension: ext,
|
||||||
};
|
};
|
||||||
expect(info.os).toBe('darwin');
|
expect(info.os).toBe('darwin');
|
||||||
expect(info.arch).toBe('arm64');
|
expect(info.arch).toBe('aarch64');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('exports all binary types', () => {
|
it('exports all binary types', () => {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
export type SupportedOS = 'darwin' | 'linux' | 'windows';
|
export type SupportedOS = 'darwin' | 'linux' | 'windows';
|
||||||
|
|
||||||
/** Supported CPU architectures */
|
/** Supported CPU architectures */
|
||||||
export type SupportedArch = 'amd64' | 'arm64';
|
export type SupportedArch = 'amd64' | 'aarch64';
|
||||||
|
|
||||||
/** Archive extension based on platform */
|
/** Archive extension based on platform */
|
||||||
export type ArchiveExtension = 'tar.gz' | 'zip';
|
export type ArchiveExtension = 'tar.gz' | 'zip';
|
||||||
|
|||||||
Reference in New Issue
Block a user