From 350d374ef41e510db0a5f296e1826fb7e6a26d7d Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Tue, 23 Jun 2020 18:41:23 +0300 Subject: [PATCH] fix find in current machine --- dist/index.js | 3 ++- src/installer.ts | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 2c97db222..f4a59afc6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6944,7 +6944,8 @@ function getGo(versionSpec, stable, auth) { // If not found in cache, download if (toolPath) { console.log(`Found in cache @ ${toolPath}`); - return toolPath; + const toolcachePath = yield tc.cacheDir(toolPath, 'go', makeSemver(versionSpec)); + return toolcachePath; } console.log(`Attempting to download ${versionSpec}...`); let downloadPath = ''; diff --git a/src/installer.ts b/src/installer.ts index 7194552a4..881f329ad 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -39,11 +39,15 @@ export async function getGo( // check cache let toolPath: string; toolPath = tc.find('go', versionSpec); - // If not found in cache, download if (toolPath) { console.log(`Found in cache @ ${toolPath}`); - return toolPath; + const toolcachePath = await tc.cacheDir( + toolPath, + 'go', + makeSemver(versionSpec) + ); + return toolcachePath; } console.log(`Attempting to download ${versionSpec}...`); let downloadPath = '';