Skip to content

Commit 2e40994

Browse files
committed
feat: add arch to getInfoFromDist
1 parent c7e4d38 commit 2e40994

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/installer.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export async function getNode(
9797
// Download from nodejs.org
9898
//
9999
if (!downloadPath) {
100-
info = await getInfoFromDist(versionSpec);
100+
info = await getInfoFromDist(versionSpec, arch);
101101
if (!info) {
102102
throw new Error(
103103
`Unable to find Node version '${versionSpec}' for platform ${osPlat} and architecture ${osArch}.`
@@ -192,10 +192,11 @@ async function getInfoFromManifest(
192192
}
193193

194194
async function getInfoFromDist(
195-
versionSpec: string
195+
versionSpec: string,
196+
arch: string = os.arch()
196197
): Promise<INodeVersionInfo | null> {
197198
let osPlat: string = os.platform();
198-
let osArch: string = translateArchToDistUrl(os.arch());
199+
let osArch: string = translateArchToDistUrl(arch);
199200

200201
let version: string;
201202

@@ -219,6 +220,7 @@ async function getInfoFromDist(
219220
return <INodeVersionInfo>{
220221
downloadUrl: url,
221222
resolvedVersion: version,
223+
arch: osArch,
222224
fileName: fileName
223225
};
224226
}

0 commit comments

Comments
 (0)