mirror of
https://github.com/actions/setup-java.git
synced 2025-03-13 09:37:03 +00:00
Apply suggestions from code review
Co-authored-by: Maxim Lobanov <maxim-lobanov@github.com>
This commit is contained in:
parent
b752570d1c
commit
702749fb5a
1 changed files with 3 additions and 6 deletions
|
@ -12,8 +12,6 @@ const supportedPlatform = `'linux', 'linux-musl', 'macos', 'solaris', 'windows'`
|
|||
|
||||
const supportedArchitecture = `'x86', 'x64', 'armv7', 'aarch64', 'ppc64le'`;
|
||||
|
||||
const first = () => true;
|
||||
|
||||
export class LibericaDistributions extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
super('Liberica', installerOptions);
|
||||
|
@ -51,8 +49,7 @@ export class LibericaDistributions extends JavaBase {
|
|||
|
||||
const satisfiedVersion = availableVersions
|
||||
.filter(item => isVersionSatisfies(range, item.version))
|
||||
.sort((a, b) => -semver.compareBuild(a.version, b.version))
|
||||
.find(first);
|
||||
.sort((a, b) => -semver.compareBuild(a.version, b.version))[0];
|
||||
|
||||
if (!satisfiedVersion) {
|
||||
const availableOptions = availableVersions.map(item => item.version).join(', ');
|
||||
|
@ -120,7 +117,7 @@ export class LibericaDistributions extends JavaBase {
|
|||
return { bitness: '64', arch: 'ppc' };
|
||||
default:
|
||||
throw new Error(
|
||||
`Architecture '${this.architecture}' not supported. Supported architecture: ${supportedArchitecture}`
|
||||
`Architecture '${this.architecture}' is not supported. Supported architectures: ${supportedArchitecture}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +135,7 @@ export class LibericaDistributions extends JavaBase {
|
|||
return 'solaris';
|
||||
default:
|
||||
throw new Error(
|
||||
`Platform '${platform}' not supported. Supported platform: ${supportedPlatform}`
|
||||
`Platform '${platform}' is not supported. Supported platforms: ${supportedPlatform}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue