From 0111cab16331e34786805c933993238fb849d136 Mon Sep 17 00:00:00 2001 From: redanthrax Date: Tue, 28 Jun 2022 13:37:53 -0700 Subject: [PATCH] change download for win32 --- dist/setup/index.js | 9 ++++++++- src/installer.ts | 8 +++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index b1b2105..842cb00 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -62214,7 +62214,14 @@ function resolveVersionFromManifest(versionSpec, stable, auth) { function installGoVersion(info, auth) { return __awaiter(this, void 0, void 0, function* () { core.info(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`); - const downloadPath = yield tc.downloadTool(info.downloadUrl, undefined, auth); + let downloadPath; + const platform = os_1.default.platform(); + if (platform === 'win32') { + downloadPath = yield tc.downloadTool(info.downloadUrl, info.fileName, auth); + } + else { + downloadPath = yield tc.downloadTool(info.downloadUrl, undefined, auth); + } core.info('Extracting Go...'); let extPath = yield extractGoArchive(downloadPath); core.info(`Successfully extracted go to ${extPath}`); diff --git a/src/installer.ts b/src/installer.ts index c1a1e39..48c4cb4 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -132,7 +132,13 @@ async function installGoVersion( auth: string | undefined ): Promise { core.info(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`); - const downloadPath = await tc.downloadTool(info.downloadUrl, undefined, auth); + let downloadPath: string; + const platform = os.platform(); + if(platform === 'win32') { + downloadPath = await tc.downloadTool(info.downloadUrl, info.fileName, auth); + } else { + downloadPath = await tc.downloadTool(info.downloadUrl, undefined, auth); + } core.info('Extracting Go...'); let extPath = await extractGoArchive(downloadPath);