mirror of https://github.com/actions/setup-go.git
minor fix
This commit is contained in:
parent
f62329616a
commit
a965b3d479
|
@ -63231,9 +63231,13 @@ function getGo(versionSpec, checkLatest, auth, arch = os_1.default.arch()) {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
let manifest;
|
||||
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) {
|
||||
core.info('Attempting to resolve the latest version from the manifest...');
|
||||
manifest = yield getManifest(auth);
|
||||
const resolvedVersion = yield resolveVersionFromManifest(versionSpec, true, auth, arch, manifest);
|
||||
if (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`);
|
||||
}
|
||||
}
|
||||
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
|
||||
let toolPath;
|
||||
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 {
|
||||
info = yield getInfoFromManifest(versionSpec, true, auth, arch);
|
||||
info = yield getInfoFromManifest(versionSpec, true, auth, arch, manifest);
|
||||
if (info) {
|
||||
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;
|
||||
}
|
||||
catch (err) {
|
||||
console.log('didnt fail');
|
||||
core.info('Unable to resolve a version from the manifest...');
|
||||
core.debug(err.message);
|
||||
}
|
||||
|
@ -63361,6 +63361,7 @@ function getInfoFromManifest(versionSpec, stable, auth, arch = os_1.default.arch
|
|||
core.debug('No manifest cached');
|
||||
manifest = yield getManifest(auth);
|
||||
}
|
||||
console.log('didnt fail898998');
|
||||
core.info(`matching ${versionSpec}...`);
|
||||
const rel = yield tc.findFromManifest(versionSpec, stable, manifest, arch);
|
||||
if (rel && rel.files.length > 0) {
|
||||
|
|
|
@ -39,9 +39,21 @@ export async function getGo(
|
|||
let manifest: tc.IToolRelease[] | undefined;
|
||||
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) {
|
||||
core.info('Attempting to resolve the latest version from the manifest...');
|
||||
manifest = await getManifest(auth);
|
||||
const resolvedVersion = await resolveVersionFromManifest(
|
||||
versionSpec,
|
||||
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
|
||||
let toolPath: string;
|
||||
toolPath = tc.find('go', versionSpec, arch);
|
||||
|
@ -86,7 +85,7 @@ export async function getGo(
|
|||
// Try download from internal distribution (popular versions only)
|
||||
//
|
||||
try {
|
||||
info = await getInfoFromManifest(versionSpec, true, auth, arch);
|
||||
info = await getInfoFromManifest(versionSpec, true, auth, arch, manifest);
|
||||
if (info) {
|
||||
downloadPath = await installGoVersion(info, auth, arch);
|
||||
} else {
|
||||
|
@ -148,6 +147,7 @@ async function resolveVersionFromManifest(
|
|||
);
|
||||
return info?.resolvedVersion;
|
||||
} catch (err) {
|
||||
console.log('didnt fail');
|
||||
core.info('Unable to resolve a version from the manifest...');
|
||||
core.debug(err.message);
|
||||
}
|
||||
|
@ -214,7 +214,7 @@ export async function getInfoFromManifest(
|
|||
core.debug('No manifest cached');
|
||||
manifest = await getManifest(auth);
|
||||
}
|
||||
|
||||
console.log('didnt fail898998');
|
||||
core.info(`matching ${versionSpec}...`);
|
||||
|
||||
const rel = await tc.findFromManifest(versionSpec, stable, manifest, arch);
|
||||
|
|
Loading…
Reference in New Issue