minor fix

This commit is contained in:
Dmitry Shibanov 2022-12-05 20:18:53 +01:00
parent f62329616a
commit a965b3d479
2 changed files with 24 additions and 23 deletions

15
dist/setup/index.js vendored
View File

@ -63231,9 +63231,13 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
let manifest; let manifest;
let osPlat = os_1.default.platform(); let osPlat = os_1.default.platform();
if (versionSpec === utils_1.StableReleaseAlias.Stable ||
versionSpec === utils_1.StableReleaseAlias.OldStable) {
manifest = yield getManifest(auth);
versionSpec = yield resolveStableVersionInput(versionSpec, auth, arch, manifest);
}
if (checkLatest) { if (checkLatest) {
core.info('Attempting to resolve the latest version from the manifest...'); core.info('Attempting to resolve the latest version from the manifest...');
manifest = yield getManifest(auth);
const resolvedVersion = yield resolveVersionFromManifest(versionSpec, true, auth, arch, manifest); const resolvedVersion = yield resolveVersionFromManifest(versionSpec, true, auth, arch, manifest);
if (resolvedVersion) { if (resolvedVersion) {
versionSpec = resolvedVersion; versionSpec = resolvedVersion;
@ -63243,11 +63247,6 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
core.info(`Failed to resolve version ${versionSpec} from manifest`); core.info(`Failed to resolve version ${versionSpec} from manifest`);
} }
} }
if (versionSpec === utils_1.StableReleaseAlias.Stable ||
versionSpec === utils_1.StableReleaseAlias.OldStable) {
manifest !== null && manifest !== void 0 ? manifest : (manifest = yield getManifest(auth));
versionSpec = yield resolveStableVersionInput(versionSpec, auth, arch, manifest);
}
// check cache // check cache
let toolPath; let toolPath;
toolPath = tc.find('go', versionSpec, arch); toolPath = tc.find('go', versionSpec, arch);
@ -63263,7 +63262,7 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
// Try download from internal distribution (popular versions only) // Try download from internal distribution (popular versions only)
// //
try { try {
info = yield getInfoFromManifest(versionSpec, true, auth, arch); info = yield getInfoFromManifest(versionSpec, true, auth, arch, manifest);
if (info) { if (info) {
downloadPath = yield installGoVersion(info, auth, arch); downloadPath = yield installGoVersion(info, auth, arch);
} }
@ -63309,6 +63308,7 @@ function resolveVersionFromManifest(versionSpec, stable, auth, arch, manifest) {
return info === null || info === void 0 ? void 0 : info.resolvedVersion; return info === null || info === void 0 ? void 0 : info.resolvedVersion;
} }
catch (err) { catch (err) {
console.log('didnt fail');
core.info('Unable to resolve a version from the manifest...'); core.info('Unable to resolve a version from the manifest...');
core.debug(err.message); core.debug(err.message);
} }
@ -63361,6 +63361,7 @@ function getInfoFromManifest(versionSpec, stable, auth, arch = os_1.default.arch
core.debug('No manifest cached'); core.debug('No manifest cached');
manifest = yield getManifest(auth); manifest = yield getManifest(auth);
} }
console.log('didnt fail898998');
core.info(`matching ${versionSpec}...`); core.info(`matching ${versionSpec}...`);
const rel = yield tc.findFromManifest(versionSpec, stable, manifest, arch); const rel = yield tc.findFromManifest(versionSpec, stable, manifest, arch);
if (rel && rel.files.length > 0) { if (rel && rel.files.length > 0) {

View File

@ -39,9 +39,21 @@ export async function getGo(
let manifest: tc.IToolRelease[] | undefined; let manifest: tc.IToolRelease[] | undefined;
let osPlat: string = os.platform(); let osPlat: string = os.platform();
if (
versionSpec === StableReleaseAlias.Stable ||
versionSpec === StableReleaseAlias.OldStable
) {
manifest = await getManifest(auth);
versionSpec = await resolveStableVersionInput(
versionSpec,
auth,
arch,
manifest
);
}
if (checkLatest) { if (checkLatest) {
core.info('Attempting to resolve the latest version from the manifest...'); core.info('Attempting to resolve the latest version from the manifest...');
manifest = await getManifest(auth);
const resolvedVersion = await resolveVersionFromManifest( const resolvedVersion = await resolveVersionFromManifest(
versionSpec, versionSpec,
true, true,
@ -57,19 +69,6 @@ export async function getGo(
} }
} }
if (
versionSpec === StableReleaseAlias.Stable ||
versionSpec === StableReleaseAlias.OldStable
) {
manifest ??= await getManifest(auth);
versionSpec = await resolveStableVersionInput(
versionSpec,
auth,
arch,
manifest
);
}
// check cache // check cache
let toolPath: string; let toolPath: string;
toolPath = tc.find('go', versionSpec, arch); toolPath = tc.find('go', versionSpec, arch);
@ -86,7 +85,7 @@ export async function getGo(
// Try download from internal distribution (popular versions only) // Try download from internal distribution (popular versions only)
// //
try { try {
info = await getInfoFromManifest(versionSpec, true, auth, arch); info = await getInfoFromManifest(versionSpec, true, auth, arch, manifest);
if (info) { if (info) {
downloadPath = await installGoVersion(info, auth, arch); downloadPath = await installGoVersion(info, auth, arch);
} else { } else {
@ -148,6 +147,7 @@ async function resolveVersionFromManifest(
); );
return info?.resolvedVersion; return info?.resolvedVersion;
} catch (err) { } catch (err) {
console.log('didnt fail');
core.info('Unable to resolve a version from the manifest...'); core.info('Unable to resolve a version from the manifest...');
core.debug(err.message); core.debug(err.message);
} }
@ -214,7 +214,7 @@ export async function getInfoFromManifest(
core.debug('No manifest cached'); core.debug('No manifest cached');
manifest = await getManifest(auth); manifest = await getManifest(auth);
} }
console.log('didnt fail898998');
core.info(`matching ${versionSpec}...`); core.info(`matching ${versionSpec}...`);
const rel = await tc.findFromManifest(versionSpec, stable, manifest, arch); const rel = await tc.findFromManifest(versionSpec, stable, manifest, arch);