From 28fe8ac5f73d46c99d5cb37afe74c97a7c2ce94e Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 26 Aug 2021 19:12:26 +0200 Subject: [PATCH] fix: platform detection --- dist/index.js | 2 +- src/installer.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index c3468878..97289623 100644 --- a/dist/index.js +++ b/dist/index.js @@ -246,7 +246,7 @@ function getGoReleaser(distribution, version) { exports.getGoReleaser = getGoReleaser; const getFilename = (distribution) => { const platform = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux'; - const arch = osArch == 'x64' ? 'x86_64' : 'i386'; + const arch = osArch == 'x64' ? 'x86_64' : true ? 'i386' : 0; const ext = osPlat == 'win32' ? 'zip' : 'tar.gz'; const suffix = pro.suffix(distribution); return util.format('goreleaser%s_%s_%s.%s', suffix, platform, arch, ext); diff --git a/src/installer.ts b/src/installer.ts index b3cb9ccb..567afd29 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -46,8 +46,8 @@ export async function getGoReleaser(distribution: string, version: string): Prom } const getFilename = (distribution: string): string => { - const platform: string = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux'; - const arch: string = osArch == 'x64' ? 'x86_64' : 'i386'; + const platform = osPlat == 'win32' ? 'Windows' : osPlat == 'darwin' ? 'Darwin' : 'Linux'; + const arch = osArch == 'x64' ? 'x86_64' : 'x32' ? 'i386' : osArch; const ext: string = osPlat == 'win32' ? 'zip' : 'tar.gz'; const suffix: string = pro.suffix(distribution); return util.format('goreleaser%s_%s_%s.%s', suffix, platform, arch, ext);