From 2e40994c28e2faa662d15fea703fec55ffb771da Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 3 Sep 2020 07:54:48 -0500 Subject: [PATCH] feat: add arch to getInfoFromDist --- src/installer.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index 4553ece9..b109a58e 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -97,7 +97,7 @@ export async function getNode( // Download from nodejs.org // if (!downloadPath) { - info = await getInfoFromDist(versionSpec); + info = await getInfoFromDist(versionSpec, arch); if (!info) { throw new Error( `Unable to find Node version '${versionSpec}' for platform ${osPlat} and architecture ${osArch}.` @@ -192,10 +192,11 @@ async function getInfoFromManifest( } async function getInfoFromDist( - versionSpec: string + versionSpec: string, + arch: string = os.arch() ): Promise { let osPlat: string = os.platform(); - let osArch: string = translateArchToDistUrl(os.arch()); + let osArch: string = translateArchToDistUrl(arch); let version: string; @@ -219,6 +220,7 @@ async function getInfoFromDist( return { downloadUrl: url, resolvedVersion: version, + arch: osArch, fileName: fileName }; }