mirror of
https://gitea.com/actions/setup-java.git
synced 2025-10-26 07:16:35 +00:00
Fix Windows archives extraction issue (#689)
This commit is contained in:
@@ -10,7 +10,11 @@ import {
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models';
|
||||
import {extractJdkFile, getDownloadArchiveExtension} from '../../util';
|
||||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
renameWinArchive
|
||||
} from '../../util';
|
||||
import {HttpCodes} from '@actions/http-client';
|
||||
|
||||
const ORACLE_DL_BASE = 'https://download.oracle.com/java';
|
||||
@@ -26,11 +30,13 @@ export class OracleDistribution extends JavaBase {
|
||||
core.info(
|
||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||
);
|
||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||
|
||||
core.info(`Extracting Java archive...`);
|
||||
const extension = getDownloadArchiveExtension();
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||
}
|
||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||
|
||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||
|
||||
Reference in New Issue
Block a user