From ff965ece8d148f1cbb54ca956fb77a45f6285957 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Sun, 27 Oct 2024 21:01:22 +0100 Subject: [PATCH] arm platform support --- src/installer.ts | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index 7709a24..b91c406 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -63,11 +63,30 @@ export async function getUPX(version: string): Promise { } function getName(version: string): string { - let platform = ''; - if (osPlat == 'win32') { - platform = osArch == 'x64' ? 'win64' : 'win32'; - } else if (osPlat == 'linux') { - platform = osArch == 'x64' ? 'amd64_linux' : 'i386_linux'; + let platform: string; + switch (osArch) { + case 'x64': { + platform = osPlat === 'win32' ? 'win64' : 'amd64_' + osPlat; + break; + } + case 'x32': { + platform = osPlat === 'win32' ? 'win32' : 'i386_' + osPlat; + break; + } + case 'arm': { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const arm_version = (process.config.variables as any).arm_version; + if (arm_version === '7') { + platform = 'armeb_' + osPlat; + } else { + platform = 'arm_' + osPlat; + } + break; + } + default: { + platform = osArch + '_' + osPlat; + break; + } } return util.format('upx-%s-%s', version, platform); }