3
0
Fork 0
mirror of https://gitea.com/actions/setup-node.git synced 2024-11-25 03:29:33 +01:00

feat: add arch to queryDistForMatch

This commit is contained in:
Amin Yahyaabadi 2020-09-03 08:49:37 -05:00
parent 82271389a6
commit 66f3e9f7ce

View file

@ -205,7 +205,7 @@ async function getInfoFromDist(
let version: string; let version: string;
version = await queryDistForMatch(versionSpec); version = await queryDistForMatch(versionSpec, arch);
if (!version) { if (!version) {
return null; return null;
} }
@ -273,9 +273,12 @@ function evaluateVersions(versions: string[], versionSpec: string): string {
return version; return version;
} }
async function queryDistForMatch(versionSpec: string): Promise<string> { async function queryDistForMatch(
versionSpec: string,
arch: string = os.arch()
): Promise<string> {
let osPlat: string = os.platform(); let osPlat: string = os.platform();
let osArch: string = translateArchToDistUrl(os.arch()); let osArch: string = translateArchToDistUrl(arch);
// node offers a json list of versions // node offers a json list of versions
let dataFileName: string; let dataFileName: string;