Skip to content

Commit

Permalink
add debug line
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Shibanov committed Jun 23, 2020
1 parent e8c9273 commit e71bd5d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
10 changes: 3 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6939,7 +6939,7 @@ function getGo(versionSpec, stable, auth) {
let osArch = os_1.default.arch();
// check cache
let toolPath;
toolPath = tc.find('go', versionSpec);
toolPath = tc.find('go', makeSemver(versionSpec));
// If not found in cache, download
if (toolPath) {
console.log(`Found in cache @ ${toolPath}`);
Expand All @@ -6952,7 +6952,8 @@ function getGo(versionSpec, stable, auth) {
// Try download from internal distribution (popular versions only)
//
try {
info = yield getInfoFromManifest(versionSpec, stable, auth);
info = yield getInfoFromManifest(makeSemver(versionSpec), stable, auth);
console.log(`info is ${info}`);
if (info) {
console.log(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
downloadPath = yield installGoVersion(info, auth);
Expand Down Expand Up @@ -6994,11 +6995,6 @@ function getGo(versionSpec, stable, auth) {
exports.getGo = getGo;
function installGoVersion(info, auth) {
return __awaiter(this, void 0, void 0, function* () {
const localPath = tc.find('go', info.resolvedVersion);
if (localPath) {
console.log(`Found in cache @ ${localPath}`);
return localPath;
}
console.log(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
const downloadPath = yield tc.downloadTool(info.downloadUrl, undefined, auth);
console.log('Extracting Go...');
Expand Down
11 changes: 3 additions & 8 deletions src/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function getGo(

// check cache
let toolPath: string;
toolPath = tc.find('go', versionSpec);
toolPath = tc.find('go', makeSemver(versionSpec));

// If not found in cache, download
if (toolPath) {
Expand All @@ -50,7 +50,8 @@ export async function getGo(
// Try download from internal distribution (popular versions only)
//
try {
info = await getInfoFromManifest(versionSpec, stable, auth);
info = await getInfoFromManifest(makeSemver(versionSpec), stable, auth);
console.log(`info is ${info}`);
if (info) {
console.log(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
downloadPath = await installGoVersion(info, auth);
Expand Down Expand Up @@ -100,12 +101,6 @@ async function installGoVersion(
info: IGoVersionInfo,
auth: string | undefined
): Promise<string> {
const localPath = tc.find('go', info.resolvedVersion);
if (localPath) {
console.log(`Found in cache @ ${localPath}`);
return localPath;
}

console.log(`Acquiring ${info.resolvedVersion} from ${info.downloadUrl}`);
const downloadPath = await tc.downloadTool(info.downloadUrl, undefined, auth);

Expand Down

0 comments on commit e71bd5d

Please sign in to comment.