mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 09:56:46 +00:00
Fix test
This commit is contained in:
parent
ef8955b635
commit
d2ec614519
2 changed files with 8 additions and 6 deletions
6
dist/setup/index.js
vendored
6
dist/setup/index.js
vendored
|
@ -13926,8 +13926,8 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
|
||||||
return jdkVersions;
|
return jdkVersions;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getPlatformOption() {
|
getPlatformOption(platform = process.platform /* for testing */) {
|
||||||
switch (process.platform) {
|
switch (platform) {
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
return { archive: 'tar.gz', os: 'macos' };
|
return { archive: 'tar.gz', os: 'macos' };
|
||||||
case 'win32':
|
case 'win32':
|
||||||
|
@ -13935,7 +13935,7 @@ class MicrosoftDistributions extends base_installer_1.JavaBase {
|
||||||
case 'linux':
|
case 'linux':
|
||||||
return { archive: 'tar.gz', os: 'linux' };
|
return { archive: 'tar.gz', os: 'linux' };
|
||||||
default:
|
default:
|
||||||
throw new Error(`Platform '${process.platform}' is not supported. Supported platforms: 'darwin', 'linux', 'win32'`);
|
throw new Error(`Platform '${platform}' is not supported. Supported platforms: 'darwin', 'linux', 'win32'`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
convertVersionToSemver(version) {
|
convertVersionToSemver(version) {
|
||||||
|
|
|
@ -89,8 +89,10 @@ export class MicrosoftDistributions extends JavaBase {
|
||||||
return jdkVersions;
|
return jdkVersions;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getPlatformOption(): PlatformOptions {
|
private getPlatformOption(
|
||||||
switch (process.platform) {
|
platform: NodeJS.Platform = process.platform /* for testing */
|
||||||
|
): PlatformOptions {
|
||||||
|
switch (platform) {
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
return { archive: 'tar.gz', os: 'macos' };
|
return { archive: 'tar.gz', os: 'macos' };
|
||||||
case 'win32':
|
case 'win32':
|
||||||
|
@ -99,7 +101,7 @@ export class MicrosoftDistributions extends JavaBase {
|
||||||
return { archive: 'tar.gz', os: 'linux' };
|
return { archive: 'tar.gz', os: 'linux' };
|
||||||
default:
|
default:
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Platform '${process.platform}' is not supported. Supported platforms: 'darwin', 'linux', 'win32'`
|
`Platform '${platform}' is not supported. Supported platforms: 'darwin', 'linux', 'win32'`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue