minor refactoring

This commit is contained in:
Maxim Lobanov 2021-03-08 18:31:01 +03:00
parent cfdcd6827b
commit 1d25bcb6a7
6 changed files with 49 additions and 114 deletions

View file

@ -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;
}

View file

@ -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');
}
}