Skip to content

Commit 7bbeb80

Browse files
authored
Fix typo (#380)
1 parent d854b6d commit 7bbeb80

File tree

9 files changed

+37
-37
lines changed

9 files changed

+37
-37
lines changed

__tests__/cleanup-java.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('cleanup', () => {
2626
resetState();
2727
});
2828

29-
it('does not fail nor warn even when the save provess throws a ReserveCacheError', async () => {
29+
it('does not fail nor warn even when the save process throws a ReserveCacheError', async () => {
3030
spyCacheSave.mockImplementation((paths: string[], key: string) =>
3131
Promise.reject(
3232
new cache.ReserveCacheError(

__tests__/distributors/corretto-installer.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ describe('getAvailableVersions', () => {
144144
});
145145
});
146146

147-
const mockPlatform = (distributon: CorrettoDistribution, platform: string) => {
148-
distributon['getPlatformOption'] = () => platform;
147+
const mockPlatform = (distribution: CorrettoDistribution, platform: string) => {
148+
distribution['getPlatformOption'] = () => platform;
149149
const mockedExtension = platform === 'windows' ? 'zip' : 'tar.gz';
150150
spyGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
151151
};

__tests__/distributors/zulu-installer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ describe('findPackageForDownload', () => {
110110
['15', '15.0.2+7'],
111111
['9.0.0', '9.0.0+0'],
112112
['9.0', '9.0.1+0'],
113-
['8.0.262', '8.0.262+19'], // validate correct choise between [8.0.262.17, 8.0.262.19, 8.0.262.18]
113+
['8.0.262', '8.0.262+19'], // validate correct choice between [8.0.262.17, 8.0.262.19, 8.0.262.18]
114114
['8.0.262+17', '8.0.262+17'],
115115
['15.0.1+8', '15.0.1+8'],
116116
['15.0.1+9', '15.0.1+9']

dist/cleanup/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68253,7 +68253,7 @@ function save(id) {
6825368253
return __awaiter(this, void 0, void 0, function* () {
6825468254
const packageManager = findPackageManager(id);
6825568255
const matchedKey = core.getState(CACHE_MATCHED_KEY);
68256-
// Inputs are re-evaluted before the post action, so we want the original key used for restore
68256+
// Inputs are re-evaluated before the post action, so we want the original key used for restore
6825768257
const primaryKey = core.getState(STATE_CACHE_PRIMARY_KEY);
6825868258
if (!primaryKey) {
6825968259
core.warning('Error retrieving key from state.');

dist/setup/index.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103458,7 +103458,7 @@ function save(id) {
103458103458
return __awaiter(this, void 0, void 0, function* () {
103459103459
const packageManager = findPackageManager(id);
103460103460
const matchedKey = core.getState(CACHE_MATCHED_KEY);
103461-
// Inputs are re-evaluted before the post action, so we want the original key used for restore
103461+
// Inputs are re-evaluated before the post action, so we want the original key used for restore
103462103462
const primaryKey = core.getState(STATE_CACHE_PRIMARY_KEY);
103463103463
if (!primaryKey) {
103464103464
core.warning('Error retrieving key from state.');
@@ -103865,13 +103865,13 @@ class JavaBase {
103865103865
};
103866103866
}
103867103867
setJavaDefault(version, toolPath) {
103868-
const majorVerssion = version.split('.')[0];
103868+
const majorVersion = version.split('.')[0];
103869103869
core.exportVariable('JAVA_HOME', toolPath);
103870103870
core.addPath(path_1.default.join(toolPath, 'bin'));
103871103871
core.setOutput('distribution', this.distribution);
103872103872
core.setOutput('path', toolPath);
103873103873
core.setOutput('version', version);
103874-
core.exportVariable(`JAVA_HOME_${majorVerssion}_${this.architecture.toUpperCase()}`, toolPath);
103874+
core.exportVariable(`JAVA_HOME_${majorVersion}_${this.architecture.toUpperCase()}`, toolPath);
103875103875
}
103876103876
}
103877103877
exports.JavaBase = JavaBase;
@@ -103975,33 +103975,33 @@ class CorrettoDistribution extends base_installer_1.JavaBase {
103975103975
const arch = this.architecture;
103976103976
const imageType = this.packageType;
103977103977
if (core.isDebug()) {
103978-
console.time('coretto-retrieve-available-versions');
103978+
console.time('corretto-retrieve-available-versions');
103979103979
}
103980103980
const availableVersionsUrl = 'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json';
103981103981
const fetchCurrentVersions = yield this.http.getJson(availableVersionsUrl);
103982103982
const fetchedCurrentVersions = fetchCurrentVersions.result;
103983103983
if (!fetchedCurrentVersions) {
103984103984
throw Error(`Could not fetch latest corretto versions from ${availableVersionsUrl}`);
103985103985
}
103986-
const eligbleVersions = (_b = (_a = fetchedCurrentVersions === null || fetchedCurrentVersions === void 0 ? void 0 : fetchedCurrentVersions[platform]) === null || _a === void 0 ? void 0 : _a[arch]) === null || _b === void 0 ? void 0 : _b[imageType];
103987-
const availableVersions = this.getAvailableVersionsForPlatform(eligbleVersions);
103986+
const eligibleVersions = (_b = (_a = fetchedCurrentVersions === null || fetchedCurrentVersions === void 0 ? void 0 : fetchedCurrentVersions[platform]) === null || _a === void 0 ? void 0 : _a[arch]) === null || _b === void 0 ? void 0 : _b[imageType];
103987+
const availableVersions = this.getAvailableVersionsForPlatform(eligibleVersions);
103988103988
if (core.isDebug()) {
103989103989
this.printAvailableVersions(availableVersions);
103990103990
}
103991103991
return availableVersions;
103992103992
});
103993103993
}
103994-
getAvailableVersionsForPlatform(eligbleVersions) {
103994+
getAvailableVersionsForPlatform(eligibleVersions) {
103995103995
const availableVersions = [];
103996-
for (const version in eligbleVersions) {
103997-
const availableVersion = eligbleVersions[version];
103996+
for (const version in eligibleVersions) {
103997+
const availableVersion = eligibleVersions[version];
103998103998
for (const fileType in availableVersion) {
103999103999
const skipNonExtractableBinaries = fileType != util_1.getDownloadArchiveExtension();
104000104000
if (skipNonExtractableBinaries) {
104001104001
continue;
104002104002
}
104003104003
const availableVersionDetails = availableVersion[fileType];
104004-
const correttoVersion = this.getCorettoVersion(availableVersionDetails.resource);
104004+
const correttoVersion = this.getCorrettoVersion(availableVersionDetails.resource);
104005104005
availableVersions.push({
104006104006
checksum: availableVersionDetails.checksum,
104007104007
checksum_sha256: availableVersionDetails.checksum_sha256,
@@ -104017,13 +104017,13 @@ class CorrettoDistribution extends base_installer_1.JavaBase {
104017104017
}
104018104018
printAvailableVersions(availableVersions) {
104019104019
core.startGroup('Print information about available versions');
104020-
console.timeEnd('coretto-retrieve-available-versions');
104020+
console.timeEnd('corretto-retrieve-available-versions');
104021104021
console.log(`Available versions: [${availableVersions.length}]`);
104022104022
console.log(availableVersions.map(item => `${item.version}: ${item.correttoVersion}`).join(', '));
104023104023
core.endGroup();
104024104024
}
104025104025
getPlatformOption() {
104026-
// Coretto has its own platform names so we need to map them
104026+
// Corretto has its own platform names so we need to map them
104027104027
switch (process.platform) {
104028104028
case 'darwin':
104029104029
return 'macos';
@@ -104033,7 +104033,7 @@ class CorrettoDistribution extends base_installer_1.JavaBase {
104033104033
return process.platform;
104034104034
}
104035104035
}
104036-
getCorettoVersion(resource) {
104036+
getCorrettoVersion(resource) {
104037104037
const regex = /(\d+.+)\//;
104038104038
const match = regex.exec(resource);
104039104039
if (match === null) {

src/cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export async function save(id: string) {
116116
const packageManager = findPackageManager(id);
117117
const matchedKey = core.getState(CACHE_MATCHED_KEY);
118118

119-
// Inputs are re-evaluted before the post action, so we want the original key used for restore
119+
// Inputs are re-evaluated before the post action, so we want the original key used for restore
120120
const primaryKey = core.getState(STATE_CACHE_PRIMARY_KEY);
121121

122122
if (!primaryKey) {

src/distributions/base-installer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ export abstract class JavaBase {
142142
}
143143

144144
protected setJavaDefault(version: string, toolPath: string) {
145-
const majorVerssion = version.split('.')[0];
145+
const majorVersion = version.split('.')[0];
146146
core.exportVariable('JAVA_HOME', toolPath);
147147
core.addPath(path.join(toolPath, 'bin'));
148148
core.setOutput('distribution', this.distribution);
149149
core.setOutput('path', toolPath);
150150
core.setOutput('version', version);
151-
core.exportVariable(`JAVA_HOME_${majorVerssion}_${this.architecture.toUpperCase()}`, toolPath);
151+
core.exportVariable(`JAVA_HOME_${majorVersion}_${this.architecture.toUpperCase()}`, toolPath);
152152
}
153153
}

src/distributions/corretto/installer.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import path from 'path';
55
import { extractJdkFile, getDownloadArchiveExtension } from '../../util';
66
import { JavaBase } from '../base-installer';
77
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
8-
import { ICorrettoAllAvailableVersions, ICorettoAvailableVersions } from './models';
8+
import { ICorrettoAllAvailableVersions, ICorrettoAvailableVersions } from './models';
99

1010
export class CorrettoDistribution extends JavaBase {
1111
constructor(installerOptions: JavaInstallerOptions) {
@@ -66,13 +66,13 @@ export class CorrettoDistribution extends JavaBase {
6666
return resolvedVersion;
6767
}
6868

69-
private async getAvailableVersions(): Promise<ICorettoAvailableVersions[]> {
69+
private async getAvailableVersions(): Promise<ICorrettoAvailableVersions[]> {
7070
const platform = this.getPlatformOption();
7171
const arch = this.architecture;
7272
const imageType = this.packageType;
7373

7474
if (core.isDebug()) {
75-
console.time('coretto-retrieve-available-versions');
75+
console.time('corretto-retrieve-available-versions');
7676
}
7777

7878
const availableVersionsUrl =
@@ -85,8 +85,8 @@ export class CorrettoDistribution extends JavaBase {
8585
throw Error(`Could not fetch latest corretto versions from ${availableVersionsUrl}`);
8686
}
8787

88-
const eligbleVersions = fetchedCurrentVersions?.[platform]?.[arch]?.[imageType];
89-
const availableVersions = this.getAvailableVersionsForPlatform(eligbleVersions);
88+
const eligibleVersions = fetchedCurrentVersions?.[platform]?.[arch]?.[imageType];
89+
const availableVersions = this.getAvailableVersionsForPlatform(eligibleVersions);
9090

9191
if (core.isDebug()) {
9292
this.printAvailableVersions(availableVersions);
@@ -96,19 +96,19 @@ export class CorrettoDistribution extends JavaBase {
9696
}
9797

9898
private getAvailableVersionsForPlatform(
99-
eligbleVersions: ICorrettoAllAvailableVersions['os']['arch']['imageType'] | undefined
100-
): ICorettoAvailableVersions[] {
101-
const availableVersions: ICorettoAvailableVersions[] = [];
99+
eligibleVersions: ICorrettoAllAvailableVersions['os']['arch']['imageType'] | undefined
100+
): ICorrettoAvailableVersions[] {
101+
const availableVersions: ICorrettoAvailableVersions[] = [];
102102

103-
for (const version in eligbleVersions) {
104-
const availableVersion = eligbleVersions[version];
103+
for (const version in eligibleVersions) {
104+
const availableVersion = eligibleVersions[version];
105105
for (const fileType in availableVersion) {
106106
const skipNonExtractableBinaries = fileType != getDownloadArchiveExtension();
107107
if (skipNonExtractableBinaries) {
108108
continue;
109109
}
110110
const availableVersionDetails = availableVersion[fileType];
111-
const correttoVersion = this.getCorettoVersion(availableVersionDetails.resource);
111+
const correttoVersion = this.getCorrettoVersion(availableVersionDetails.resource);
112112

113113
availableVersions.push({
114114
checksum: availableVersionDetails.checksum,
@@ -124,9 +124,9 @@ export class CorrettoDistribution extends JavaBase {
124124
return availableVersions;
125125
}
126126

127-
private printAvailableVersions(availableVersions: ICorettoAvailableVersions[]) {
127+
private printAvailableVersions(availableVersions: ICorrettoAvailableVersions[]) {
128128
core.startGroup('Print information about available versions');
129-
console.timeEnd('coretto-retrieve-available-versions');
129+
console.timeEnd('corretto-retrieve-available-versions');
130130
console.log(`Available versions: [${availableVersions.length}]`);
131131
console.log(
132132
availableVersions.map(item => `${item.version}: ${item.correttoVersion}`).join(', ')
@@ -135,7 +135,7 @@ export class CorrettoDistribution extends JavaBase {
135135
}
136136

137137
private getPlatformOption(): string {
138-
// Coretto has its own platform names so we need to map them
138+
// Corretto has its own platform names so we need to map them
139139
switch (process.platform) {
140140
case 'darwin':
141141
return 'macos';
@@ -146,7 +146,7 @@ export class CorrettoDistribution extends JavaBase {
146146
}
147147
}
148148

149-
private getCorettoVersion(resource: string): string {
149+
private getCorrettoVersion(resource: string): string {
150150
const regex = /(\d+.+)\//;
151151
const match = regex.exec(resource);
152152
if (match === null) {

src/distributions/corretto/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface ICorrettoAllAvailableVersions {
1414
};
1515
}
1616

17-
export interface ICorettoAvailableVersions {
17+
export interface ICorrettoAvailableVersions {
1818
version: string;
1919
fileType: string;
2020
checksum: string;

0 commit comments

Comments
 (0)