From 3eb4bc9d685415820bbce79073db385b2ce8279a Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Thu, 3 Sep 2020 07:24:52 -0500 Subject: [PATCH] feat: add arch to acquireNodeFromFallbackLocation --- src/installer.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/installer.ts b/src/installer.ts index 8d0f3d7..310d79f 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -107,7 +107,10 @@ export async function getNode( downloadPath = await tc.downloadTool(info.downloadUrl); } catch (err) { if (err instanceof tc.HTTPError && err.httpStatusCode == 404) { - return await acquireNodeFromFallbackLocation(info.resolvedVersion); + return await acquireNodeFromFallbackLocation( + info.resolvedVersion, + info.arch + ); } throw err; @@ -317,10 +320,11 @@ export async function getVersionsFromDist(): Promise { // Note also that the files are normally zipped but in this case they are just an exe // and lib file in a folder, not zipped. async function acquireNodeFromFallbackLocation( - version: string + version: string, + arch: string = os.arch() ): Promise { let osPlat: string = os.platform(); - let osArch: string = translateArchToDistUrl(os.arch()); + let osArch: string = translateArchToDistUrl(arch); // Create temporary folder to download in to const tempDownloadFolder: string =