mirror of
				https://github.com/actions/setup-java.git
				synced 2025-11-04 08:20:54 +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 supportedArchitecture = `'x86', 'x64', 'armv7', 'aarch64', 'ppc64le'`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const first = () => true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export class LibericaDistributions extends JavaBase {
 | 
					export class LibericaDistributions extends JavaBase {
 | 
				
			||||||
  constructor(installerOptions: JavaInstallerOptions) {
 | 
					  constructor(installerOptions: JavaInstallerOptions) {
 | 
				
			||||||
    super('Liberica', installerOptions);
 | 
					    super('Liberica', installerOptions);
 | 
				
			||||||
| 
						 | 
					@ -51,8 +49,7 @@ export class LibericaDistributions extends JavaBase {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const satisfiedVersion = availableVersions
 | 
					    const satisfiedVersion = availableVersions
 | 
				
			||||||
      .filter(item => isVersionSatisfies(range, item.version))
 | 
					      .filter(item => isVersionSatisfies(range, item.version))
 | 
				
			||||||
      .sort((a, b) => -semver.compareBuild(a.version, b.version))
 | 
					      .sort((a, b) => -semver.compareBuild(a.version, b.version))[0];
 | 
				
			||||||
      .find(first);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!satisfiedVersion) {
 | 
					    if (!satisfiedVersion) {
 | 
				
			||||||
      const availableOptions = availableVersions.map(item => item.version).join(', ');
 | 
					      const availableOptions = availableVersions.map(item => item.version).join(', ');
 | 
				
			||||||
| 
						 | 
					@ -120,7 +117,7 @@ export class LibericaDistributions extends JavaBase {
 | 
				
			||||||
        return { bitness: '64', arch: 'ppc' };
 | 
					        return { bitness: '64', arch: 'ppc' };
 | 
				
			||||||
      default:
 | 
					      default:
 | 
				
			||||||
        throw new Error(
 | 
					        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';
 | 
					        return 'solaris';
 | 
				
			||||||
      default:
 | 
					      default:
 | 
				
			||||||
        throw new Error(
 | 
					        throw new Error(
 | 
				
			||||||
          `Platform '${platform}' not supported. Supported platform: ${supportedPlatform}`
 | 
					          `Platform '${platform}' is not supported. Supported platforms: ${supportedPlatform}`
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue