From 988c5ef874f72f9891df888e7df19ee36942dd96 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 27 Aug 2021 00:41:33 +0200 Subject: [PATCH] fix: platform detection v2 --- dist/index.js | 2 +- src/installer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 97289623..e008e4b8 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' : true ? 'i386' : 0; + const arch = osArch == 'x64' ? 'x86_64' : osArch == 'x32' ? 'i386' : osArch; 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 63dba0b3..94f48eb5 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -47,7 +47,7 @@ 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' : 'x32' ? 'i386' : osArch; + const arch: string = osArch == 'x64' ? 'x86_64' : osArch == '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);