Skip to content

Commit

Permalink
fix find in current machine
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Shibanov committed Jun 23, 2020
1 parent 48cfc17 commit 350d374
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
8 changes: 6 additions & 2 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down

0 comments on commit 350d374

Please sign in to comment.