fix: Make Go installer respect cache input

pull/388/head
Quentin Laplanche 2 years ago committed by GitHub
parent 992f068900
commit 989752598d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,7 +34,8 @@ export async function getGo(
versionSpec: string, versionSpec: string,
checkLatest: boolean, checkLatest: boolean,
auth: string | undefined, auth: string | undefined,
arch = os.arch() arch = os.arch(),
cache: boolean
) { ) {
let manifest: tc.IToolRelease[] | undefined; let manifest: tc.IToolRelease[] | undefined;
const osPlat: string = os.platform(); const osPlat: string = os.platform();
@ -83,12 +84,14 @@ export async function getGo(
} }
// check cache // check cache
if (cache) {
const toolPath = tc.find('go', versionSpec, arch); const toolPath = tc.find('go', versionSpec, arch);
// If not found in cache, download // If not found in cache, download
if (toolPath) { if (toolPath) {
core.info(`Found in cache @ ${toolPath}`); core.info(`Found in cache @ ${toolPath}`);
return toolPath; return toolPath;
} }
}
core.info(`Attempting to download ${versionSpec}...`); core.info(`Attempting to download ${versionSpec}...`);
let downloadPath = ''; let downloadPath = '';
let info: IGoVersionInfo | null = null; let info: IGoVersionInfo | null = null;

@ -36,7 +36,8 @@ export async function run() {
versionSpec, versionSpec,
checkLatest, checkLatest,
auth, auth,
arch arch,
cache
); );
const installDirVersion = path.basename(path.dirname(installDir)); const installDirVersion = path.basename(path.dirname(installDir));

Loading…
Cancel
Save