diff --git a/dist/index.js b/dist/index.js index 8e3ff4b5f..36590a023 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6953,9 +6953,8 @@ function getGo(versionSpec, stable, auth) { // try { info = yield getInfoFromManifest(makeSemver(versionSpec), stable, auth); - console.log(`info is ${info}`); if (info) { - downloadPath = yield installGoVersion(info, auth); + downloadPath = yield installGoVersion(info, auth, undefined); } else { console.log('Not found in manifest. Falling back to download directly from Go'); @@ -6981,7 +6980,7 @@ function getGo(versionSpec, stable, auth) { throw new Error(`Unable to find Go version '${versionSpec}' for platform ${osPlat} and architecture ${osArch}.`); } try { - downloadPath = yield installGoVersion(info, undefined); + downloadPath = yield installGoVersion(info, undefined, 'go'); } catch (err) { throw new Error(`Failed to download version ${versionSpec}: ${err}`); @@ -6991,12 +6990,12 @@ function getGo(versionSpec, stable, auth) { }); } exports.getGo = getGo; -function installGoVersion(info, auth) { +function installGoVersion(info, auth, subDir) { return __awaiter(this, void 0, void 0, function* () { console.log(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`); const downloadPath = yield tc.downloadTool(info.downloadUrl, undefined, auth); console.log('Extracting Go...'); - const extPath = yield extractGoArchive(downloadPath); + let extPath = yield extractGoArchive(downloadPath); console.log('Adding to the cache ...'); return yield tc.cacheDir(extPath, 'go', makeSemver(info.resolvedVersion)); }); diff --git a/src/installer.ts b/src/installer.ts index 22338a1ae..1a84aa7e2 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -51,9 +51,8 @@ export async function getGo( // try { info = await getInfoFromManifest(makeSemver(versionSpec), stable, auth); - console.log(`info is ${info}`); if (info) { - downloadPath = await installGoVersion(info, auth); + downloadPath = await installGoVersion(info, auth, undefined); } else { console.log( 'Not found in manifest. Falling back to download directly from Go' @@ -86,7 +85,7 @@ export async function getGo( } try { - downloadPath = await installGoVersion(info, undefined); + downloadPath = await installGoVersion(info, undefined, 'go'); } catch (err) { throw new Error(`Failed to download version ${versionSpec}: ${err}`); } @@ -97,13 +96,14 @@ export async function getGo( async function installGoVersion( info: IGoVersionInfo, - auth: string | undefined + auth: string | undefined, + subDir: string | undefined ): Promise { console.log(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`); const downloadPath = await tc.downloadTool(info.downloadUrl, undefined, auth); console.log('Extracting Go...'); - const extPath = await extractGoArchive(downloadPath); + let extPath = await extractGoArchive(downloadPath); console.log('Adding to the cache ...'); return await tc.cacheDir(extPath, 'go', makeSemver(info.resolvedVersion));