mirror of
https://github.com/actions/setup-java.git
synced 2025-04-20 09:56:46 +00:00
minor refactoring
This commit is contained in:
parent
cfdcd6827b
commit
1d25bcb6a7
6 changed files with 49 additions and 114 deletions
|
@ -60,7 +60,7 @@ export abstract class JavaBase {
|
|||
}
|
||||
|
||||
protected findInToolcache(): JavaInstallerResults | null {
|
||||
// we can't use tc.find directly because firstly, we need to filter versions by stability
|
||||
// we can't use tc.find directly because firstly, we need to filter versions by stability flag
|
||||
// if *-ea is provided, take only ea versions from toolcache, otherwise - only stable versions
|
||||
const availableVersions = tc
|
||||
.findAllVersions(this.toolcacheFolderName, this.architecture)
|
||||
|
@ -97,7 +97,7 @@ export abstract class JavaBase {
|
|||
let stable = true;
|
||||
|
||||
if (version.endsWith('-ea')) {
|
||||
version = version.replace('-ea', '');
|
||||
version = version.replace(/-ea$/, '');
|
||||
stable = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -69,10 +69,10 @@ export class LocalDistribution extends JavaBase {
|
|||
}
|
||||
|
||||
protected async findPackageForDownload(version: semver.Range): Promise<JavaDownloadRelease> {
|
||||
throw new Error('Should not be implemented');
|
||||
throw new Error('This method should not be implemented in local file provider');
|
||||
}
|
||||
|
||||
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||
throw new Error('Should not be implemented');
|
||||
throw new Error('This method should not be implemented in local file provider');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue