Skip to content

Commit 7569de0

Browse files
committed
rename dist manifest to node versions
1 parent b20a256 commit 7569de0

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

dist/setup/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62343,7 +62343,7 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
6234362343
return __awaiter(this, void 0, void 0, function* () {
6234462344
// Store manifest data to avoid multiple calls
6234562345
let manifest;
62346-
let distManifest;
62346+
let nodeVersions;
6234762347
let osPlat = os.platform();
6234862348
let osArch = translateArchToDistUrl(arch);
6234962349
if (isLtsAlias(versionSpec)) {
@@ -62353,8 +62353,8 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
6235362353
versionSpec = resolveLtsAliasFromManifest(versionSpec, stable, manifest);
6235462354
}
6235562355
if (isLatestSyntax(versionSpec)) {
62356-
distManifest = yield getVersionsFromDist();
62357-
versionSpec = yield queryDistForMatch(versionSpec, arch, distManifest);
62356+
nodeVersions = yield getVersionsFromDist();
62357+
versionSpec = yield queryDistForMatch(versionSpec, arch, nodeVersions);
6235862358
core.info(`getting latest node version...`);
6235962359
}
6236062360
if (checkLatest) {
@@ -62408,7 +62408,7 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) {
6240862408
// Download from nodejs.org
6240962409
//
6241062410
if (!downloadPath) {
62411-
info = yield getInfoFromDist(versionSpec, arch, distManifest);
62411+
info = yield getInfoFromDist(versionSpec, arch, nodeVersions);
6241262412
if (!info) {
6241362413
throw new Error(`Unable to find Node version '${versionSpec}' for platform ${osPlat} and architecture ${osArch}.`);
6241462414
}
@@ -62508,11 +62508,11 @@ function getInfoFromManifest(versionSpec, stable, auth, osArch = translateArchTo
6250862508
return info;
6250962509
});
6251062510
}
62511-
function getInfoFromDist(versionSpec, arch = os.arch(), distManifest) {
62511+
function getInfoFromDist(versionSpec, arch = os.arch(), nodeVersions) {
6251262512
return __awaiter(this, void 0, void 0, function* () {
6251362513
let osPlat = os.platform();
6251462514
let osArch = translateArchToDistUrl(arch);
62515-
let version = yield queryDistForMatch(versionSpec, arch, distManifest);
62515+
let version = yield queryDistForMatch(versionSpec, arch, nodeVersions);
6251662516
if (!version) {
6251762517
return null;
6251862518
}
@@ -62571,7 +62571,7 @@ function evaluateVersions(versions, versionSpec) {
6257162571
}
6257262572
return version;
6257362573
}
62574-
function queryDistForMatch(versionSpec, arch = os.arch(), distManifest) {
62574+
function queryDistForMatch(versionSpec, arch = os.arch(), nodeVersions) {
6257562575
return __awaiter(this, void 0, void 0, function* () {
6257662576
let osPlat = os.platform();
6257762577
let osArch = translateArchToDistUrl(arch);
@@ -62590,16 +62590,16 @@ function queryDistForMatch(versionSpec, arch = os.arch(), distManifest) {
6259062590
default:
6259162591
throw new Error(`Unexpected OS '${osPlat}'`);
6259262592
}
62593-
if (!distManifest) {
62593+
if (!nodeVersions) {
6259462594
core.debug('No dist manifest cached');
62595-
distManifest = yield getVersionsFromDist();
62595+
nodeVersions = yield getVersionsFromDist();
6259662596
}
6259762597
let versions = [];
6259862598
if (isLatestSyntax(versionSpec)) {
6259962599
core.info(`getting latest node version...`);
62600-
return distManifest[0].version;
62600+
return nodeVersions[0].version;
6260162601
}
62602-
distManifest.forEach((nodeVersion) => {
62602+
nodeVersions.forEach((nodeVersion) => {
6260362603
// ensure this version supports your os and platform
6260462604
if (nodeVersion.files.indexOf(dataFileName) >= 0) {
6260562605
versions.push(nodeVersion.version);

src/installer.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function getNode(
3838
) {
3939
// Store manifest data to avoid multiple calls
4040
let manifest: INodeRelease[] | undefined;
41-
let distManifest: INodeVersion[] | undefined;
41+
let nodeVersions: INodeVersion[] | undefined;
4242
let osPlat: string = os.platform();
4343
let osArch: string = translateArchToDistUrl(arch);
4444

@@ -52,8 +52,8 @@ export async function getNode(
5252
}
5353

5454
if (isLatestSyntax(versionSpec)) {
55-
distManifest = await getVersionsFromDist();
56-
versionSpec = await queryDistForMatch(versionSpec, arch, distManifest);
55+
nodeVersions = await getVersionsFromDist();
56+
versionSpec = await queryDistForMatch(versionSpec, arch, nodeVersions);
5757
core.info(`getting latest node version...`);
5858
}
5959

@@ -127,7 +127,7 @@ export async function getNode(
127127
// Download from nodejs.org
128128
//
129129
if (!downloadPath) {
130-
info = await getInfoFromDist(versionSpec, arch, distManifest);
130+
info = await getInfoFromDist(versionSpec, arch, nodeVersions);
131131
if (!info) {
132132
throw new Error(
133133
`Unable to find Node version '${versionSpec}' for platform ${osPlat} and architecture ${osArch}.`
@@ -274,15 +274,15 @@ async function getInfoFromManifest(
274274
async function getInfoFromDist(
275275
versionSpec: string,
276276
arch: string = os.arch(),
277-
distManifest?: INodeVersion[]
277+
nodeVersions?: INodeVersion[]
278278
): Promise<INodeVersionInfo | null> {
279279
let osPlat: string = os.platform();
280280
let osArch: string = translateArchToDistUrl(arch);
281281

282282
let version: string = await queryDistForMatch(
283283
versionSpec,
284284
arch,
285-
distManifest
285+
nodeVersions
286286
);
287287

288288
if (!version) {
@@ -362,7 +362,7 @@ function evaluateVersions(versions: string[], versionSpec: string): string {
362362
async function queryDistForMatch(
363363
versionSpec: string,
364364
arch: string = os.arch(),
365-
distManifest?: INodeVersion[]
365+
nodeVersions?: INodeVersion[]
366366
): Promise<string> {
367367
let osPlat: string = os.platform();
368368
let osArch: string = translateArchToDistUrl(arch);
@@ -383,19 +383,19 @@ async function queryDistForMatch(
383383
throw new Error(`Unexpected OS '${osPlat}'`);
384384
}
385385

386-
if (!distManifest) {
386+
if (!nodeVersions) {
387387
core.debug('No dist manifest cached');
388-
distManifest = await getVersionsFromDist();
388+
nodeVersions = await getVersionsFromDist();
389389
}
390390

391391
let versions: string[] = [];
392392

393393
if (isLatestSyntax(versionSpec)) {
394394
core.info(`getting latest node version...`);
395-
return distManifest[0].version;
395+
return nodeVersions[0].version;
396396
}
397397

398-
distManifest.forEach((nodeVersion: INodeVersion) => {
398+
nodeVersions.forEach((nodeVersion: INodeVersion) => {
399399
// ensure this version supports your os and platform
400400
if (nodeVersion.files.indexOf(dataFileName) >= 0) {
401401
versions.push(nodeVersion.version);

0 commit comments

Comments
 (0)