From 945e28744caebefe60a0f18661815d4268da3102 Mon Sep 17 00:00:00 2001 From: = Date: Sat, 27 Jul 2024 13:28:30 -0700 Subject: [PATCH] Add linux arm64 support --- src/installer.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/installer.ts b/src/installer.ts index 7709a24..31e86d0 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -62,12 +62,23 @@ export async function getUPX(version: string): Promise { return exePath; } +function getLinuxPlatform(arch: string): string { + switch(arch) { + case 'x64': + return 'amd64_linux'; + case 'arm64': + return 'arm64_linux'; + default: + return 'i386_linux'; + } +} + 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'; + platform = getLinuxPlatform(osArch); } return util.format('upx-%s-%s', version, platform); }